In this and next posts, we will learn about L2 (Ethernet) switching and L3 (IP) routing. This post will cover:
Switching and Routing
Please take a close look at the figure above, especially server/router MAC address, IP address, and switch/router port (interface) numbers in it, as it illustrates the configuration of a network to be discussed here and in the next post.
As seen in the left side of the figure above, if both sender (e.g. SVR1 in the figure) and receiver (e.g. SVR2) are located in the same network (LAN), the two communicate with each other directly through the switch between them (e.g. S1) without having to go through the router (e.g. R1). At this time, each packet consists of the following fields:
Header | Fields | |
Ethernet Header
|
* Destination MAC = m2, the MAC address of the receiver (SVR2) * Source MAC = m1, the MAC address of the sender (SVR1) |
|
IP Header
|
* Destination IP = 1.1.1.20, the IP address of the receiver (SVR2) * Source IP = 1.1.1.10, the IP address of the sender (SVR1) |
On the other hand, if the two are not located in the same network (LAN), they communicate through the router (R1). In this case, Ethernet header fields have different values on this and the other side of the router.
Sending packets from SVR1 to R1
Header | Fields | |
Ethernet Header
|
* Destination MAC = a1, the MAC address of the router (R1 ge1/1) * Source MAC = m1, the MAC address of the sender (SVR1) |
|
IP Header
|
* Destination IP = 2.1.1.30, the IP address of the receiver (SVR3) * Source IP = 1.1.1.10, the IP address of the sender (SVR1) |
Sending packets from R1 to SVR3
Header | Fields | |
Ethernet Header
|
* Destination MAC = m3, the MAC address of the receiver (SVR3) * Source MAC = a2, the MAC address of the router (R1 ge2/1) |
|
IP Header
|
* Destination IP = 2.1.1.30, the IP address of the receiver (SVR3) * Source IP = 1.1.1.10, the IP address of the sender (SVR1) |
Ethernet Switching
1. SVR1 sends ARP Request
Header | Fields | |
Ethernet Header
|
* Destination MAC = FF:FF:FF:FF:FF:FF (broadcasting: reaching all servers/routers in the same LAN) * Source MAC = m1, the MAC address of the sender (SVR1) |
|
ARP Header
|
* Sender MAC = m1, the MAC address of the sender (SVR1) * Sender IP = 1.1.1.10, the IP address of the sender (SVR1) * Target MAC = 00:00:00:00:00:00 (the value that SVR1 wants to find out)
* Target IP = 1.1.1.20, the IP address of the intended receiver (SVR2)
|
2. SVR2 responds with ARP Reply
Header | Fields | |
Ethernet Header
|
* Destination MAC = m1, the MAC address of SVR1 to which ARP reply is to be delivered * Source MAC = m2, the MAC address of the sender (SVR2) |
|
ARP Header
|
* Sender MAC = m2, the MAC address of the sender (SVR2) * Sender IP = 1.1.1.20, the IP address of the sender (SVR2) * Target MAC = m1, the MAC address of the intended receiver (SVR1)
* Target IP = 1.1.1.10, the IP address of the intended receiver (SVR1)
|
3. SVR1 sends IP Packet to SVR2
Header | Fields | |
Ethernet Header
|
* Destination MAC = m2, the MAC address of the receiver (SVR2) * Source MAC = m1, the MAC address of the sender (SVR1) |
|
IP Header
|
* Destination IP = 1.1.1.20, the IP address of the receiver (SVR2) * Source IP = 1.1.1.10, the IP address of the sender (SVR1)
|
NEtmanias! Another well explained post by you. As switching and routing both are the most important when you are engaged with networks. I've learned a lot and definitely it will help me out in my final semester project.
"1. SVR1 sends ARP Request
Now, this packet is received by S1 (Switch 1), and the source MAC address of the received packet (the switch does not care whether the received packet is IP or ARP) is learned. Then, the following is recorded in the MAC table at S1: {MAC address m2 is connected to fe2 port}."
I think should be: {MAC address m1 is connected to fe1 port}.
The typo has been fixed, thanks.
Very useful to teach students.
cheers,
such a wonderful explaination.
Really, enjoyed reading and very clear explanation. Thanks lot to Netmanias. It is very very useful for me as experience IT professional.
My sincere thanks to this great article with simple terms.
I have one minor doubt.
By SVR(SVR1,SVR2,SVR3), do you mean server(server1, server2,server3).
Yes, you are correct