The following steps show a simplified TCP/IP transaction to get an IP address.
- Open Web Browser and enter IP Address for Development Board
- PC Generates and Transmits a Frame
- Frame Forwarded through the Switch
- Frame Arrives at Development Board and Forwarded to Web Server
- Web Server Sends the Webpage to the PC
Assume we have an embedded network device we want to control and monitor. One way we could do this is to create a web page on the embedded device that displays the status of the embedded device. This web page could also be used to control the device.
1 Open Web Browser and enter IP Address for Development Board
We will use a web browser on the PC to access a web page on the development board.
Note the PC and development board in this example currently have an IP address. This also means the switch has seen a frame sent from each node, so the switch’s routing table has been updated to show which MAC address is connected to each port.
We open a web browser on the PC and enter the IP address for the development board.
2 PC Generates and Transmits a Frame
The PC creates a frame of data then sends it to the PHY to transmit on the local network.
This frame was initiated by the web browser when it created a message requesting to download the web page found at IP address 192.168.1.102.
3 Frame Forwarded through the Switch
The Frame arrives at the switch and it is opened to find the destination MAC address. This MAC address is found in the routing table so it sends it out Port 0.
Note that the switch only opens the frame to determine the MAC address. A switch is a layer 2 device and is only concerned with layer 2 (MAC) addresses. It doesn’t touch the packet or care what the IP address is.
4 Frame Arrives at Development Board and Forwarded to Web Server
The frame arrives at the development board and the message is delivered to the web server application. Let’s look at this process in more detail.
When the frame arrives at the development board, the destination MAC address is checked to determine if it needs to pay attention to the frame. The MAC address matches its own, so it opens the frame to check the destination IP address in the packet. The development board finds the destination IP address matches its own so it opens the packet to see what the message is. The development board finds the message is for a web server. The board happens to have a web server running on it, so it sends the message to the web server application.
If the MAC address in the Frame doesn’t match the device’s MAC address, the Frame will be discarded by the Data Link Layer (Layer 2).
If the IP address in the Packet doesn’t match the device’s IP address, the Packet will be discarded by the Network Layer (Layer 3).
If a Message is sent to an application (port number) that is not running in the device it will be discarded by the Transport Layer (Layer 4).
5 Web Server Sends the Webpage to the PC
Now it’s time for the development board to send the web page. The development board generates a message containing the web page then sends the frame to the PC. Let’s look at this process in more detail.
The web server running on the development board generates a message containing the web page. The board then adds the source and destination IP addresses to create a packet and adds the source and destination MAC addresses creating a frame. This frame is then sent to the PHY for transmission on the local network.
Question: What happens next?
- The frame is received at the switch.
- The switch finds the frame’s destination MAC address and uses its routing table to determine what port to forward the frame to.
- The frame is sent to the PC
- The PC opens the frame and checks the destination MAC address to determine if it needs to pay attention to it.
- The PC opens the packet and checks the destination IP address
- The PC opens the message and finds the web page (which is just an HTML file) it requested.