A-level Computing 2009/AQA/Computer Components, The Stored Program Concept and the Internet/Structure of the Internet/TCP IP protocol stack





MAC Address
IP addresses change, for example if you connect your laptop to the internet at home you get one IP address. If you were then to take it around a friends and connect there, you would be given another IP address. MAC addresses are unique to the device they are given to and every network interface has a MAC address, including mobile phones, games consoles and wireless cards. This is important when you consider that a computer can have more than one network interface. For example with a laptop you might have a cat-6 network card and a wireless card, one handling BitTorrent and the other web browsing. When you receive a message, which network interface should it be sent to? The MAC address would mean that messages can be directed to a particular network interface, namely the wireless card or the cat-6 card. In a moment you will see how we use MAC addresses with the TCP/IP stack.


 * In order to view your device's MAC address in a Windows OS, go to Control panel >> Network and Sharing Center >>  Click on your connection (This can be Ethernet, WLAN (Wi-Fi) etc...)
 * Click on the "Details" button and you will find a label called "Physical Address". This is your MAC Address



TCP/IP stack
The most common protocol on the internet is the Transmission Control Protocol/Internet Protocol (TCP/IP). To send data over a TCP/IP network requires four steps or layers:

To show you how the TCP/IP stack works we going to use the following data as an example: Matt, Mark, Luke, John

Application
The application layer makes sure that the data is sent in a format that will be understandable by the recipient. This will mean formatting data to be sent in a standard way applicable to that application, for example HTTP, FTP etc. In this case we are going to wrap each piece of data in XML tags.

Matt Mark  Luke  John

Transport
The transport layer looks at the data to be sent and splits it into chunks that can fit into data packets. It then attaches a number to each, specifying that packet's order, this allows the recipient to place the data back together correctly at the other end. To each packet it then attaches a port number dependent on the application being used. For the example we'll send data to port 60
 * Splits the data into chunks and adds order number
 * Adds port numbers

Network/Internet
The network layer attaches the IP address of the sender, so that the recipient will know who sent it and who to send a confirmation message to. It must also attach the IP address of the host that it is sending the data to so it doesn't get lost! In this case we are sending to 102.231.4.189 and sending from 98.1.232.99. Combined with the port number this creates a socket that data is being sent from and a socket that data is being sent to, namely 102.231.4.189:60
 * Attaches sender IP address
 * Attaches destination IP address to create a socket

Link
Finally the link layer attaches the MAC address of the sender and the recipient, allowing the packets to be directed to a specific network interface on the IP Address host machine. In this case the sender is using a wireless card with MAC address: 00-17-4F-08-5D-69 and the destination MAC address is: 11-22-33-44-55
 * Attaches sender MAC address
 * Attaches destination MAC address

These four packets can then be sent across the internet holding enough information for them to:
 * 1) reach their destination (socket from the Network and Transport Layers)
 * 2) find the correct network interface (MAC address from the Link Layer)
 * 3) find the correct service(Port number from the Transport Layer)
 * 4) be reassembled in the correct order (Order information from the Transport Layer)
 * 5) deliver the intended message (data from the Application Layer)

TCP/IP does a great job of ensuring that the data you request is sent correctly and the data you send is received. However, as you have seen, sometimes data can get lost on the internet or packets can arrive in an order differing to the one you sent them in. With something like a computer game or telecommunications you can't wait for a slow packet to find its way across the internet. This would result in voice messages slowing down and computer games becoming unresponsive. There is another protocol called UDP that doesn't ask for a confirmation that data packets have been received. This protocol is used heavily in networked computer games and voice over IP, as losing a packet here and there won't impact too badly on the overall game experience or voice conversation. When you play computer games, you might see something that says "lost packets = xyz" or when having a web meeting the quality of voice or video might briefly degrade. This is packet loss in action and a result of using UDP.

Show the steps involved in sending the following data:
 * data = Hello (this will fit in one packet)
 * from IP = 12.32.72.2 | MAC = 43.65.FF.23
 * to  IP = 98.125.43.88 | Port = 80 | MAC = A0.3D.EF.00


 * Application
 * "Hello"
 * Transport
 * :80
 * 1/1
 * "Hello"
 * Internet
 * To=98.125.43.88
 * From=12.32.72.2
 * :80
 * 1/1
 * "Hello"
 * Link
 * From MAC = 43.65.FF.23
 * To MAC = A0.3D.EF.00
 * To=98.125.43.88
 * From=12.32.72.2
 * :80
 * 1/1
 * "Hello"

Réseaux TCP/IP/La pile TCP/IP