Suppose, there are 2 networks e.g.
Network A (Network id: 192.168.0.0) and Network B (Network id: 192.168.1.0).
In-Network A, two computer PC0
and PC1 are connected via switch0 and there are associated with IP 192.168.0.2
and IP 192.168.0.3 respectively. Where the default gateway of network A is 192.168.0.1
connected to one of the interfaces of router0.
Similarly, Other two computer e.g.
PC2 and PC3 are connected via switch1 in Network B. Two IP address 192.168.1.2
and 192.168.1.3 are assigned statically in PC2 and PC3 respectively. And the
most important thing is the default gateway address of this network is 192.168.1.1
assigned to the router0.
if a computer PC0 in Network A
wants some data to send to the PC3 in Network B. The communicate follows the TCP/IP
five-layer protocol.
Data are prepared to send to the transport layer in the application layer in PC0. Then, the transport layer makes a segment based on the size of the data. The source and destination port address
field of a segment will be assigned the expected receiving service’s port
address as destination port address and according to the system OS, the source port
is assigned from ephemeral port address range. Then other fields of a segment
according to the requirements.
In the network layer, the source The IP address will be its own IP address and destination IP address will be the server The IP address in the IP datagram. The TTL field in the datagram sets to 64 as a standard
value. And other fields fill up according to the requirements.
Then in the data link layer, a frame
is made up with source MAC address and destination MAC address. The source MAC address
will be its own hardware address. But destination MAC address is found by ARP (Address
Resolution Protocol). As the destination, IP has not belonged to its own Network,
PC0 makes an ARP broadcast address for its gateway IP address. So, the result of
ARP broadcasting message, it is easily known the gateway router MAC address. Then,
based on the MAC addresses and payload received by network layer and other value,
an ethernet frame is made.
After that, the physical layer sends
that data as an electrical modulated signal or light signal via optical fibre.
When the transmitting data are received
to the corresponding switch0. It examines the destination MAC address, and forward
that data to the gateway router.
Then when the data hit the
gateway router, the router does the following task:
1. receive
frame.
2. examine
the destination MAC address
3. calculate
Checksum
4. compared
the checksum of the frame
5. match
detected.
If the destination MAC address is
matched with its own MAC address and checksum is correct, the ethernet frame is
accepted. Secondly, the destination IP address is examined, and trying to find out
the network in the routing table and decrease one of the TTL value.
As the destination network is directly
connected to this router. The router makes up IP datagram with modified TTL
value, then using ARP table, it finds the corresponding MAC address for the destination
IP address.
Finally, the data get into its
final destination via switch1. And destination PC3 encloses the data.
Diagram looks great
ReplyDelete