This article is a part of a series on Packet Traveling — everything that happens in order to get a packet from here to there. Use the navigation boxes to view the rest of the articles.
- OSI Model
- Key Players
- Host to Host Communication
- Host to Host through a Switch
- Host to Host through a Router
- Packet Traveling – Series Finale
In this series, we studied the different layers of the OSI Model, and how each of the seven layers provides a unique service which the other layers depend on.
We also studied the key players of the Internet, where we defined a Host, Client, Server, Switch, Router, and ARP. As well as each of their unique roles in moving a packet its path.
We then looked at the specific workings of a Switch, and its exact functions as it facilitates communication within a network. Then we looked at the specific workings of a Router, and exactly how it facilitates communication between networks.
Finally, its time to finish the Packet Traveling series with a video that ties everything together. In the following video, we will look at everything that happens to get data from Host A to Host D, as it passes from a Host, through a Switch, to a Router, through another Switch, and finally to its final destination.
Thank you for this awesome series, can you make an series over a campus network which includes bunch of proxy server as a gateway for their respective subnets and bunch of switches(when one switch is connected to another one) and access points to cover larger area..
Hi Dhruv, glad you enjoyed it. You asked for a bunch of different topics, more than what could realistically fit in one article or article series. All I can say is stay tuned, and look out for individual articles or series that will speak to those subjects.
Ed, in your video at 11:20. When the packet got to Host B, the host stripped L3 and L3. How does Host B still have information to send back the response? How does it know that Host A should get a response when L2 and L3 are gone?
The L3 header is no longer needed, so it is stripped. That doesn’t mean information from the L3 header can’t be recorded and used later (to know where to respond).
The L2 header is formed from Host B, based upon what host B recorded from the L3 header (Source IP of initial sender), and the contents of Host B’s ARP table.
Thank you.
When does the broadcast IP get used as opposed to the broadcast FF:FF:FF:FF:FF:FF?
I’m thinking that the broadcast FF:FF:FF:FF:FF:FF is used at computer A,B,C,D and at Switches 1 and Switches 2.
When does the broadcast IP get used? The broadcast IP of a 10.10.10.0 /24 is 10.10.10.255 for my question if that helps.
Would routers only use the broadcast IP then?
Any help is very appreciated!
L3 Broadcast will be needed for a client looking for IP address from DHCP server – Eg when you do ipconfig / renew on PC or when when you are setting up the client for the first time.
For routers, If you configure “ip address DHCP” for an interface, then also the router will do a L3 broadcast intially to get the IP address for that interface.
Also, an L3 broadcast will in turn require a L2 broadcast to find out the MAC address of all the hosts in the network for which you requested the L3 broadcast initially.
Whenever a broadcast message has a L3 header, the destination IP address will be the broadcast IP address — ex: 10.10.10.255 in the network 10.10.10.0/24.
Whenever a broadcast message has a L2 header, the destination MAC address will be the broadcast MAC address — ex: FFFF.FFFF.FFFF.
Amazing series. By far the most lucid I’ve come across. I will be refering any interested parties to this site in the future. I am still a bit confused on the relation between subnet masks and private Ips.
I know that any realistic router is going to assign each device on the network a private ip and perform name address translation on ingoing and outgoing packets (using port mapping). But I am uncertain of why this doesn’t render the whole concept of the subnet mask redundant. Is a subnet mask used only for cases when an outside client needs to specifically address a host behind a router outside of its own network? Even then my understanding is that protocols have been developed which allow for two computers to communicate directly using NAT. If so wouldn’t it make more sense for most networks to have all octets of the IP address be network rather than host?
Hi James, glad you enjoyed the series =)
I intentionally avoided the subject of Subnets in this article series. Mostly because to cover that subject properly would require another series entirely (which is on my list to work on, in fact, so stay tuned, or sign up to get updates).
But to answer your question, the purpose of the subnet mask is to define for the host what IP addresses are on their local network (and by deduction, which IP addresses are on a foreign network). The host will use that information to determine whether the ARP should be sent for the final host itself, or for the default gateway.
If all the host bits were network, then the host would consider every IP address on the local network, and would never send the packet to the default gateway. Of course, there are services like Proxy ARP that exist to help out in such situations, but they shouldn’t be depended on.
Hope this helps!
Thanks for the speedy response Ed! I am definitely looking forward to all future series. Perhaps my source of confusion regards the distinction between a private network and a local one. My understanding is that the IETF has reserved several IP ranges for “private internets” and are “not publicly routable on the “global internet.” I had assumed, based on this, that the host would determine whether to send out an ARP request to the default gateway on the basis of whether the destination IP was in this reserved range or not.
This makes sense to my neophyte mind because then the some 4.3 billion IP addresses of IPv4 could each refer to a potentially massive network and all local routing could be handled with the private ips in the reserved range.
Perhaps I am merely imagining simple home networks and not considering issues that could crop up in larger corprate networks (eg subnets inside of subnets). Any thoughts on how I’ve gotten so bumfuzzled?
Hi James,
The “local” network is the IP network to which a host is directly attached to. Foreign networks are every other network. This applies whether the IP addresses are Public or Private.
For example, in the network for the article which covers routing, Host A’s local network is
11.11.11.0/24
, which includes the range of IP addresses11.11.11.0
–11.11.11.255
. Every address other than this range is a foreign network, and will require sending a packet to the default gateway to speak to.The function of the subnet mask is to determine the size of Host A’s local network. For example, if Host A had the IP address
11.11.11.77/25
, this would tell Host A that every IP in the range of11.11.11.0
–11.11.11.127
was in Host A’s local network, and every remaining IP address was in a foreign network.This whole analogy would work the exact same if you replaced the first octet of each IP network in the illustration with a “10”. For instance, if the networks from left to right were
10.11.11.0/24
,10.22.22.0/24
, and10.33.33.0/24
network. In this case, all the IP space is Private IP addresses, but host B and Host C are (still) in foreign networks, from the perspective of Host A.Hope this helps!
Hi,
I have doubt in default gateway ip address. As you have mentioned in the video if the host sends the packet to another host in a different network that should go via default gateway. suppose if default gateway not configured in host then what will happen? suppose wrong default gateway ip address mentioned in the host, In that scenario how the host will send the packet to a destination?
Hi Sen,
If the default gateway is not configured, or if the default gateway is misconfigured, the host is unable to speak to a host on a foreign network.
You can easily test this by intentionally misconfiguring your own default gateway and you’ll notice you won’t have any connectivity to foreign networks.
hi,
if i want to send data between 2 devices on same subnet, will router be required in this case?? or only switch will work??
Plz help
Hi Ana,
A Router is only needed if you need to speak between two networks. If two hosts on the same network are speaking to each other, they do not need a Router. They can instead be connected through a switch, or connected directly to each other.
Hi there,
I have a quick question about the cut-through method by which a switch can forward frames.
You were saying that the switch stores nothing, but when I looked at another article it says “switch copies into its memory only the destination MAC address”.
http://www.ciscopress.com/articles/article.asp?p=357103&seqNum=4
Could you please clarity this for me?
Thanks.
Hi Sir,
It was really very good tutorial and I learnt a lot and understood these topic.
Also the way you explained is awesome
Awesome explanation .. It just cleared all my doubts.
Thanks a lot !!
Could you please elaborate on packet travel when we hit google.com in a browser?
Thank you
Consider “Host D” as Google’s web server or a DNS server. Consider the “Data” payload as either an HTTP request or a DNS request. Then add a few more routers, and you pretty much have the entire process for what occurs when you type “google.com” in a web browser.
Please make an article on dynamic routing and how it works ….
Hi James. Thanks for the suggestion. I’ve recently made a video discussing Route Precedence, it might provide some insight into how Dynamic Routing works:
https://www.practicalnetworking.net/stand-alone/route-precedence-how-does-a-router-choose-its-preferred-path/
There are also a few EIGRP articles already published:
https://www.practicalnetworking.net/stand-alone/eigrp-terminology/
https://www.practicalnetworking.net/stand-alone/eigrp-metric/
https://www.practicalnetworking.net/stand-alone/eigrp-feasibility-condition/
#Raadhe Raadhe
In this entire series, it was discussed that if the destination in the packet is in the same subnet then it will be broadcasted to get the mac address of destination IP but if the destination is in a different subnet than it will look for the mac address of gateway first. So one question should be popped into your mind that how the host will determine whether destination present in packet is in the same subnet or different subnet?
So the answer is, there will an ANDing of below things and then the decision will be taken by the host.
1. source IP address + source subnet mask.
2. destination IP address + source subnet mask
If the resultant of both are the same then the destination is in the same subnet if not then it’s in a different subnet.
Example –
00001010.00001010.00001010.00000001 (10.10.10.1)
11111111.11111111.11111111.00000000 (255.255.255.0)
———————————————————————–
00001010.00001010.00001010.00000000 (AND result)
00001010.00001010.00001010.00000010 (10.10.10.2)
11111111.11111111.11111111.00000000 (255.255.255.0)
———————————————————————–
00001010.00001010.00001010.00000000 (AND result)
Here we go in our example is the same that’s mean the destination is in the same subnet.
You can give a try to another destination IP from another subnet. (-_-)
thanks, Ed this series really helped me to understand the concept better.
Great contribution, Chappie. Thank you! You are correct, I don’t discuss the details of Subnetting in this series. That was intentional, as I wanted to keep things as simple as possible. But if you’re interested in Subnetting, I did release a video series that discusses how to Subnet:
https://www.practicalnetworking.net/stand-alone/subnetting-mastery/
This is the best series on networking I have ever seen in my entire life. I wish I had access to articles such as yours when I was in grad school. I would have gained a very thorough understanding of the topic and would have been a better all rounded software engineer. Keep up the good work.
Hi Kiran. Thanks for the kind words =) I too wish someone had explained this to me in this way when I first got started with Networking. Glad you found it helpful =)
Let’s say there are two devices D1 and D2. D1 is behind router R1, and D2 is behind router R2. R1 and R2 each have their own local network. Now, let’s say D1 has IP 192.168.1.12 and D2 also has IP 192.168.1.12 (since they’re in different networks).
From the video, if both D1 and D2 send requests to the same external host D3 (e.g. google) the source IP will be set to 192.168.1.12. When D3 responds and sends a packet back, how does it know which 192.168.1.12 to choose? How is that IP address determined and is it ever modified throughout its journey to the destination (similar to how the L2 frame is replaced along each hop)?
R3 won’t know — that is why everything must have unique IP addresses.
Now, since you listed Private IPs (192.168.x.x), what is likely occurring is Network Address Translation. The Routers (R1, R2) are translating the host’s address from 192.168.x.x to something unique. So that when either host is speaking to D3, they have unique IP addresses, and D3 can respond to each of them using the distinct IP addresses.
You can read more about NAT here:
https://www.practicalnetworking.net/series/nat/why-nat/
Dude this series was amazing! Thank you so much for making it!
You’re welcome, Roy =)
Thanks,
Any chance to include articles to this series that include more parts/ devices of network that packet traverse (for ex. firewall, DNS & DHCP, MPLS inside ISP, Internet (from high level perspective), different medias on the WAN besides assuming all is Ethernet) ?
It would be great to have next articles that talk about this not deep but just high level to bring it closer to what happens in real world.
Again thank you so much, your articles made things more clear & connected concerning Data networks.
A lot of those topics are on my list =)
Great article! How does this change when there are multiple switches connected together? IE: If we had 2 switches connected together after the host? Does the L2 header get stripped each time it passes between the switches? Does the MAC table on the first switch have the same port listed (to the second switch) for all the MACs ?
Thanks!
I’ve got two resources to share which cover exactly that:
Article: https://www.practicalnetworking.net/stand-alone/communication-through-multiple-switches/
Video: https://www.youtube.com/watch?v=G7GyWjJtjNs
Great series, among the best I’ve seen.
On this video, one question. At 3:45 you start by saying A knows the IP address of B – how does it get that knowledge in the first place?
I go in to details on that in the updated version of this series in this video:
https://www.youtube.com/watch?v=gYN2qN11-wE
Hello can you make a more complicated version of the packet traveling, like with more switches & routers + with servers and PC’s that are making ping to each other.
Please start a series on Cyber security
This is incredible well-explained!