Transport Layer
The Transport layer is focused on the transmission of data. Data travels across the Internet in what we call "packets" and is generally sent using two main methods: Transmission Control Protocol (TCP), and User Datagram Protocol (UDP).
Transmission Control Protocol - TCP
TCP is the most reliable method of data transmission due to its strict handshaking processes. We use TCP for transmission of data that needs to be exactly the same after it's disassembled and re-assembled as it did at the start. Examples of when we use it: web pages, emails, monetary transactions.
A simplified overview of the process that happens to set up a TCP connection is as follows:
A simplified overview of the process that happens to set up a TCP connection is as follows:
- A connection is established between the two computers that want to send data to each other using a "three-way handshake"
- Computer A sends a packet with the SYN bit (stands for "sychronize?") set to 1
- Computer B sends a packet back also with the SYN bit set to 1 and and the ACK bit (stands for "acknowledge!") set to 1
- Computer A sends a packet back again with the ACK bit set to 1
- Now that the connection is set up data can be sent. Data is sent from one computer to another, with each packet received the receiving computer sends back a packet with ACK set to 1 acknowledging that specific packet was received.
- Connection is closed. This can be done by either computer. The wrap up is similar to the first "three-way handshake" except with the FIN bit set to 1 in place of the SYN bit.
So the data was sent and they all lived happily ever after... Well, not quite. Throughout this process there is the inevitability of various problems like:
In TCP all of these issues are noted and accounted for. Fortunately, because of all of the checks and balances in the process and in the "header" of the TCP packet this can be done: missing sequence data can be requested again, data that has been corrupted (according to the "checksum") can be requested again, and data can be ordered correctly. For more information on the TCP header structure you can visit this page: https://www.imperva.com/learn/ddos/tcp-transmission-control-protocol/ Once all of this has been completed we can be almost 100% certain that our data has been sent/received correctly, making TCP the best protocol to use when sending data that absolutely needs its integrity assured. |
Tasks:
1) Read through the Khan Academy resource on TCP. Make your own notes on the "three-way handshake" process. Maybe include some diagrams to help show the process. Memorise your notes, write them from memory.
2) Explain how TCP detects and handles lost packets.
3) Explain how TCP handles packets arriving out of order.
4) Explain how TCP detects that data has become corrupted.
5) Do this short multi-choice test at Khan academy
Extra reading/notes: TCP - CS Field Guide
Check sum information
1) Read through the Khan Academy resource on TCP. Make your own notes on the "three-way handshake" process. Maybe include some diagrams to help show the process. Memorise your notes, write them from memory.
2) Explain how TCP detects and handles lost packets.
3) Explain how TCP handles packets arriving out of order.
4) Explain how TCP detects that data has become corrupted.
5) Do this short multi-choice test at Khan academy
Extra reading/notes: TCP - CS Field Guide
Check sum information
User Datagram Protocol - UDP
In contrast to TCP, UDP is a far simpler process. UDP requires no handshaking of any sort, lacking handshakes at the start/end as well as all throughout the process as a receipt for packets. Because of this UDP is a whole lot faster than TCP and is good for transmission of data that needs to arrive quickly but doesn't necessarily need to be exact in terms of integrity. UDP still has a "checksum" as a part of its header so the computer receiving it can at least still determine whether the data was corrupted in some way.
UDP is a good solution for things like audio/video streaming, Teams/Zoom meetings, and online gaming as it allows for very quick transmission of data. The trade off is that when things go wrong there is no direct way to fix it and as a result we get things like audio being out of time with video, glitches in video, or character models "lagging out" and moving about crazily in games. Khan Academy - UDP |
Tasks:
1) Make your own notes about UDP and how it works. 2) Compare and contrast the processes of UDP and TCP. 3) For each of the following, determine whether it would be better to use TCP or UDP (or some combination of them both). For each give an explanation of why you think this.
|