Unicasts

Unicasts are point-to-point transmissions. The following are two examples of how TCP/IP packets travel through a network.

Slides


How a TCP/IP Packet moves within a local network

../_images/point2point.png

Let’s look at a simple example of a network packet being transmitted within one network:

IP Address

Subnet Mask

Network A

192.168.0.0

255.255.255.0

Inside of this network we have two hosts with the following IP and MAC addresses:

IP Address

MAC Address

Host A

192.168.0.100

de:ad:be:ef:09:39

Host B

192.168.0.200

de:ad:be:ef:10:b0

We want to send a TCP segments as IP packet from Host A to Host B. The IP packet will look as follows:

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.0.200

TCP Segment

Given the network configuration, Host A can determine that the destination IP address is within the same subnet of its own IP address. Its IP address is associated to a network device with the MAC address de:ad:be:ef:09:39. Using the ARP protocol, Host A will ask for the MAC address for the destination IP 192.168.0.200. Host B will answer with its own MAC address de:ad:be:ef:10:b0. Using this information, the IP packet can now put into an Ethernet frame and send over the network interface.

Ethernet Frame

Source MAC

de:ad:be:ef:09:39

Destination MAC

de:ad:be:ef:10:b0

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.0.200

TCP Segment

How a TCP/IP Packet moves to an external network

Now, what happens if an IP packet is sent to a system in a different network? Here is a configuration with two networks. A gateway/router is connected to both networks and is assigned a network IP address in each of them. The network interface connected to network A has the MAC address de:ad:be:ab:20:10, while the other network interface connected to network B has the MAC address de:ad:be:ab:20:ac

../_images/packet_to_external_network.png

IP Address

Subnet Mask

Gateway

Gateway MAC

Network A

192.168.0.0

255.255.255.0

192.168.0.1

de:ad:be:ab:20:10

Network B

192.168.1.0

255.255.255.0

192.168.1.1

de:ad:be:ab:20:ac

IP Address

MAC Address

Host A

192.168.0.100

de:ad:be:ef:09:39

Host B

192.168.1.200

de:ad:be:ca:40:c0

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.1.200

TCP Segment

An IP Packet that is addressed to a destination outside of the IP subnet Host A is connected to will instead be transmitted to the gateway of that network. During this transmission the ARP protocol is used to determine the MAC address of the gateway IP address.

Ethernet Frame

Source MAC

de:ad:be:ef:09:39

Destination MAC

de:ad:be:ab:20:10

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.1.200

TCP Segment

The gateway/router can then choose what to do with such a packet. If the necessary routing and firewall rules are configured, the gateway will unpack the Ethernet frame, and then retransmit the IP package. In this case, the gateway is connected to two networks.

Based on the destination IP address of the packet, the gateway can determine that it must be forwarded to network B. Since the IP address is within the subnet of network B, the gateway can determine the target MAC address via ARP. The gateway will then repackage the IP packet in a new Ethernet frame addressed to this target MAC.

Ethernet Frame

Source MAC

de:ad:be:ef:09:39

Destination MAC

de:ad:be:ca:40:c0

IP Packet

Source IP

192.168.0.100

Destination IP

192.168.1.200

TCP Segment