July 15, 2024

Packet Handling


Incoming packets

The process for accepting packets from a network can be listed as:

  1. Link layer accepts the packets from the network wire (Local Area Network or modem) and removes any link layer header information (e.g. Ethernet address information). Each packet is passed to the Network layer.
  2. Network layer (IP) checks to see if a packet is corrupted and if it is, discards it. If the packet is error free, the Network layer passes it on to the Transport layer.
  3. Transport layer (TCP) checks to see if the packets have arrived in the order in which they were sent and reassembles them in the correct order if not. If a packet is missing (e.g. because IP has rejected it as corrupted) it requests re-transmission. When the complete set of packets has been assembled, TCP passes them up to the Application layer.

Outgoing packets

Here is an example of an application using Telnet; a protocol used to log in to remote computers. This used to be achieved a number of ways until Microsoft decided not to incorporate it into Windows 7. However, in earlier operating sytems one simple method was to open your browser and type, for example, telnet://locis.loc.gov into the Address field and click enter.
This is the address for the United States Library of Congress Information System.
A sequence of processes ensues, all but one of which are invisible to the user:

  1. The browser makes a request to a Domain Name System (DNS) server in order to map the name locis.loc.gov to a numeric IP address. In this instance the name is resolved to For more about the resolution of IP addresses into binary numbers, go here.
  2. Telnet instructs the transport layer to make a TCP connection to
  3. TCP assigns a port number. This is a software implementation of a channel for the data exchange. For Telnet this is port number 23.
  4. TCP creates packets ready for transmission.
  5. TCP initiates communication with the destination machine (locis.loc.gov) and gets the port number from it, ready for the transaction.
  6. TCP places the source and destination port numbers on the packets' headers.
  7. Packets are passed to the IP layer.
  8. IP adds the address of both source and destination machines and passes them down the stack to the link layer.
  9. Packets are sent from your machine to your ISP's router, which in turn passes them onto the Internet.
  10. Packets are transported via a number of routers to locis.loc.gov
  11. The LoC machine's TCP layer replies in similar fashion.
  12. Your Telnet program exchanges data with Telnet on LoC's machine about the kind of display you are using.
  13. Output is displayed on your Telnet console
screenshot of Telnet application



Next page » Origins of the Web

Previous page « TCP/IP and packets



















Up to top of page