PART 3 -Different protocols and ports

Third part of article series about how to connect Internet. In this article I talk about different protocols that are used to connect to internet and are used there. Also DNS and DHCP is talked here. To actually see these in action, you need monitoring programs or you can try to use command line to check them.

More than enough

Well as I have discovered, there are more than enough protocols and some are even same like and same named. They are easily mixed up and some parts of them are hard to remember. I introduce couple of them to you so you also get hang of them. But before them I introduce you to OSI and TCP/IP-protocols that are used to merge different protocols together.

ARP-protocol

ARP comes from words Address Resolution Protocol. This protocol is used to map MAC- and IP-addresses in the same network or worldwide. This tracks computers together and it’s used to increase security. How it works? Well this way

  1. Device A sends a survey to find owner of Ip-address X in the Y network. This survey is sended to Broadcast channel or to default gateway. This is called request
  2. If there is device B MAC-address in the in device A ARP-cache, A can send data.
  3. If device A doesn’t have this information then A send Broadcast survey to the network. All devices receives this survey and only the device thats has this particular Ip-address responses. This is called reply
  4. Both devices saves this information to their ARP-cache. Then Device A can send data to device B

IPv4 and IPv6

IPv4 and IPv6 comes from words Internet Protocol and v-number tells us the version. This is protocol basically that makes the Internet. Different computers have their own Ip-addresses and much more. To see more specific information about IPv4 and IP6v use this link. It takes you to Wikipedia.

UDP-protocol

UDP comes from words User Datagram Protocol and it’s used to deliver, sending and receiving data.  It’s mainly used with applications that send only small amounts of data. Application protocols that support well UDP are

  • DNS, Domain name Server -protocol
  • SNMP, Simple Network Managment Protocol
  • NetBIOS- server
  • NFS, Network File System -applications
  • TFTP, Trivial File Transfer Protocol

On the other and UDP lacks one crucial think, it doesn’t confirm sender and receiver that the whole data has been send or received. This means that if there comes some damaged IP-packages, they are not replaced or fixed.

TCP

TCP comes from words Transmission control Protocol and this is another data deliver, sender and receiver protocol. This is more used than UDP because this protocol doesn’t have same lacks. Instead this protocol is used when data goes from A to B straight and there are no man-in-the-middle.

When you start sending data with TCP, first goes these connestion creation package. Device A send syn message to Device B and if device B is working it receives this. Then B send Syn/ACK message to A. A receives it and sends message ACK to B. Now the connection is created, no data from particular data package is send.

When A starts to send data to B, TCP-protocol makes data to smaller amounts and names each package. Then it starts to send data to B and B sends reply for each received data package.

When data is sended is time to close connection. A sends fin message to B and A status changes to FINWAIT-1. Then B receives this message and it’s status changes to CLOSE-WAIT and B sends finwait-2 message to A. A receives this and it status changes to LAST ACK. It also sends last fin message to B. When B receives this, B status changes to TIME WAIT, and it’s changes message about this to A. Then A status changes to CLOSED and if no message is sended to B, B also changes to CLOSED.

ICMP

ICMP comes from words Internet Control Message Protocol and it is used to report problems in network. Ping and Traceroute (tracert if used in Windows cmd.exe) uses this protocol if it doesn’t find pinged address or Ip-address.

HTTP

HTTP comes from words Hybertext Transmission Protocol and it’s used mainly in browsers. What HTTP makes browsers, it’s used to create connection and download pages from World Wide Web. How it works? Well

  1. Users types specific address to URL-search bar.
  2. Browser uses DNS to get Ip-address from that named website
  3. Browser sends TCP messages to create connection to that Ip-address (basically it could be some sort of server).  It also uses port 80, HTTP-port
  4. HTTP-port sends message that it want’s to receive data from that website. It usually gets index.html first if not else said in URL-bar.
  5. Connected server sends requested data to port 80 and browser gets this data and starts to process it. If there are no pictures, videos or music HTTP shuts connection and browser shows the page.

Ever wondered what are these weird numbers in browser window like 404 and 300? Well they are reaction that HTTP also uses. here is little list about them

  • 100 -> informational
  • 200 -> Successful, connection is created and it works
  • 300 -> redirection, page no longer exist and you are redirected to new page
  • 400 -> Client errors, you have typed URL-wrong or it doesn’t exist at all.
  • 500 -> Server errors, server down or some updates are coming.

DNS

DNS is not protocol, but I added it here because it basically uses so much other protocols to work. DNS uses UDP, IP and ARP.

So what is DNS?, DNS is domain name server and it is used to map Ip-address that are permanent and have matching name in World Wide Web, like http://www.google.com .

DHCP

DHCP comes from words Dynamic Host Configuration Protocol and it’s used to gain IP-addresses, default gateway and subnetmasks from server. It could also tell DNS-server address.

This is used in internal networks and in public networks to automatically give all necessary settings to gain access to network. It’s still not same as DNS-server but it’s usually mixed together with it.

Ports

Ports are used to keep track of devices and what port is needed to use when opening files, browsing web and sending email. There are also used to different programs to deliver and receiving data. There are 65 536 possible ports where

  • 0 – 1023 ports are standard use. They are also Well Known Ports or Well Known Services.
  • 1024 – 49 151 ports are for used in other services or other software creates socket there to own use
  • 49 152 – 65 536 are in public use.

There are some ports that you use every day and some you use only when using some specific program.

-Tuomas Törmä

Sources

  • Studies in Haaga-Helia spring 2013 Course Basics of Computers and networks Teacher Petri Hirvonen

Leave a comment