top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

    Get Free Article Updates

Facebook Login
Site Registration

Data Packet flow in Network.

+2 votes

All the hosts in IPv4 environment are assigned unique logical IP addresses. When a host wants to send some data to another host on the network, it needs the physical (MAC) address of the destination host. To get the MAC address, the host broadcasts ARP message and asks to give the MAC address whoever is the owner of destination IP address. All the host on that segment receives ARP packet but only the host which has its IP matching with the one in ARP message, replies with its MAC address. Once the sender receives the MAC address of receiving station, data is sent on the physical media.

In case, the IP does not belong to the local subnet. The data is sent to the destination by means of Gateway of the subnet. To understand the packet flow we must first understand following components:

MAC Address:
Media Access Control Address is 48-bit factory hard coded physical address of network device which can uniquely be identified. This address is assigned by device manufacturers.

Address Resolution Protocol:
Address Resolution Protocol is used to acquire the MAC address of a host whose IP address is known. ARP is a Broadcast packet which is received by all the host in the network segment. But only the host whose IP is mentioned in ARP responds to it providing its MAC address.

Proxy Server:
To access Internet, network uses Proxy Server which has a public IP assigned. All PCs request Proxy Server for a Server on Internet, Proxy Server on behalf of PC sends the request to server and when it receives response from the Server, the Proxy Server forwards it to the client PC. This is a way to control Internet access in computer networks and it helps to implement web based policies.

Dynamic Host Control Protocol:
DHCP is a service by which a host is assigned IP address from a pre-defined address pool. DHCP server also provides necessary information such as Gateway IP, DNS Server Address, lease assigned with the IP etc. By using DHCP services network administrator can manage assignment of IP addresses at ease.

Domain Name System:
This is very likely that a user does not know the IP address of a remote Server he wants to connect to. When the user types in the name of remote server he wants to connect to the localhost behind the screens sends a DNS query. Domain Name System is a method to acquire the IP address of the host whose Domain Name is known.

Network Address Translation:
Almost all PCs in a computer network are assigned private IP addresses which are not routable on Internet. As soon as a router receives an IP packet with private IP address it drops it. In order to access Servers on public private address, computer networks use an address translation service, which translates between public and private addresses, called Network Address Translation. When a PC sends an IP packet out of a private network, NAT changes the private IP address with public IP address and vice versa.

We can now describe the packet flow. Assume that a user wants to access from her personal computer. She is having internet connection from her ISP. The following steps will be taken by the system to help her reach destination website.

Step: 1 – Acquiring an IP Address (DHCP)

When user’s PC boots up, it searches for a DHCP server to acquire an IP address. For the same, PC sends a DHCPDISCOVER broadcast which is received by one or more DHCP servers on the subnet and they all respond with DHCPOFFER which includes all the necessary details like IP, subnet, Gateway, DNS etc. PC sends DHCPREQUEST packet in order to request the offered IP address. Finally, DHCP sends DHCPACK packet to tell PC that it can keep the IP for some given amount of time aka IP lease.

Alternatively a PC can be assigned an IP address manually without taking any help from DHCP Server. When a PC is well configured with IP address details, it can now speak to other computers all over the IP enabled network.

Step: 2 – DNS query

When a user opens a web browser and types which is a domain name and a PC does not understand how to communicate with the server using domain names. PC sends a DNS query out on the network in order to obtain the IP address pertaining to the domain name. The pre-configured DNS server responds the query with IP address of the domain name specified.

Step: 3 – ARP request

The PC finds that the destination IP address does not belong to his own IP address range and it has to forward the request to the Gateway. Gateway in this scenario can be a router or a Proxy Server. Though Gateway’s IP address is known to the client machine but computers do not exchange data on IP addresses rather they need machine’s hardware address which is Layer-2 factory coded MAC address. To obtain the MAC address of the Gateway the client PC broadcasts an ARP request saying "Who owns this IP address?" The Gateway in response to the ARP query sends it MAC address. Upon receiving MAC address PC sends the packets to Gateway.

An IP packet has both source and destination addresses and this connects host with a remote host logically. Whereas MAC addresses helps systems on a single network segment to transfer actual data. This is important that source and destination MAC addresses change as they travel across the Internet (segment by segment) but source and destination IP address never changes.

posted Jul 28, 2014 by Vrije Mani Upadhyay

  Promote This Article
Facebook Share Button Twitter Share Button LinkedIn Share Button

Related Articles

Internet Protocol being a layer-3 protocol (OSI) takes data Segments from layer-4 (Transport) and divides it into what’s called packet. IP packet encapsulates data unit received from above layer and adds its own header information.
enter image description here

The encapsulated data is referred to as IP Payload. IP header contains all the necessary information to deliver the packet at the other end.
enter image description here

IP header includes many relevant information including Version Number, which, in this context, is 4. Other details are as follows:

Version: Version no. of Internet Protocol used (e.g. IPv4)

IHL: Internet Header Length, Length of entire IP header

DSCP: Differentiated Services Code Point, This is Type of Service.

ECN: Explicit Congestion Notification, carries information about the congestion seen in the route.

Total Length: Length of entire IP Packet (including IP header and IP Payload)

Identification: If IP packet is fragmented during the transmission, all the fragments contain same identification no. to identify original IP packet they belong to.

Flags: As required by the network resources, if IP Packet is too large to handle these ‘flags’ tell that if they can be fragmented or not. In this 3-bit flag, the MSB is always set to ‘0’.

Fragment Offset: This offset tells the exact position of the fragment in the original IP Packet.

Time to Live: To avoid looping in the network, every packet is sent with some TTL value set, which tells the network how many routers (hops) this packet can cross. At each hop, its value is decremented by one and when the value reaches zero, the packet is discarded.

Protocol: Tells the Network layer at the destination host, to which Protocol this packet belongs to, i.e. the next level Protocol. For example protocol number of ICMP is 1, TCP is 6 and UDP is 17.

Header Checksum: This field is used to keep checksum value of entire header which is then used to check if the packet is received error-free.

Source Address: 32-bit address of the Sender (or source) of the packet.

Destination Address: 32-bit address of the Receiver (or destination) of the packet.

Options: This is optional field, which is used if the value of IHL is greater than 5. These options may contain values for options such as Security, Record Route, Time Stamp etc.


Private IP Addresses

Every class of IP, (A, B & C) has some addresses reserved as Private IP addresses. These IPs can be used within a network, campus, company and are private to it. These addresses cannot be routed on Internet so packets containing these private addresses are dropped by the Routers.
Private IP Addresses
In order to communicate with outside world, Internet, these IP addresses must have to be translated to some public IP addresses using NAT process or Web Proxy server can be used.

The sole purpose to create separate range of private addresses is to control assignment of already-limited IPv4 address pool. By using private address range within LAN, the requirement of IPv4 addresses has globally decreased significantly. It has also helped delaying the IPv4 address exhaustion.

IP class, while using private address range, can be chosen as per the size and requirement of the organization. Larger organization may choose class A private IP address range where smaller may opt for class C. These IP addresses can be further sub-netted be assigned to departments within an organization.

Loopback IP Addresses

The IP address range – is reserved for loopback i.e. a Host’s self-address. Also known as localhost address. This loopback IP address is managed entirely by and within the operating system. Using loopback addresses, enable the Server and Client processes on a single system to communicate with each other. When a process creates a packet with destination address as loopback address, the operating system loops it back to itself without having any interference of NIC.

Data sent on loopback is forward by the operating system to a virtual network interface within operating system. This address is mostly used for testing purposes like client-server architecture on a single machine. Other than that, if a host machine can successfully ping or any IP from loopback range, implies that the TCP/IP software stack on the machine is successfully loaded and working.

Link-local Addresses

In case of the Host is not able to acquire an IP address from DHCP server and it has not been assigned any IP address manually, the host can assign itself an IP address from a range of reserved Link-local addresses. Link local address range is -

Assume a network segment where all systems are configured to acquire IP addresses from a DHCP server connected to the same network segment. If the DHCP server is not available, no host on the segment will be able to communicate to any other. Windows (98 or later), and Mac OS (8.0 or later) support this functionality of self-configuration of Link-local IP address. In absence of DHCP server, every host machine randomly chooses an IP address from the above mentioned range and then checks to ascertain by means of ARP, if some other host also has not configured himself with the same IP address. Once all hosts are using link local addresses of same range, they can communicate to each other.

These IP addresses cannot help system to communicate when they do not belong to the same physical or logical segment. These IPs are also not routable.

Contact Us
+91 9880187415
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Karnataka INDIA.