The transport layer is responsible for process-to-process/end-to-end/port-to-port delivery of the entire message
Header (TCP/UDP) is added to the data after it is received
Functionality
Port addressing -=> The network layer gets each packet to the correct computer; the transport layer gets the entire message to the correct process on that computer
Segmentation and Reassembly -=> A message is divided into transmittable segments, each having a sequence number
Connection Control -=> The transport layer can be either connection-less or connection-oriented
Flow Control
Control the Flow at Destination
Error Control (Checksum)
The unit is divided into K sections, each of n bits
Section 1 and 2 are added together using oneβs complement
Section 3 is added to the result of the previous step
Section 4 is added to the result of the previous step
The process repeats until section k is added to the result of the previous step
The final result is complemented to make the checksum
Headers
Protocols
TCP (Transmission Control Protocol)
Functionality
Byte Streaming
TCP creates segments (Segmentation) of bytes from the continuous stream of data (in bits) received from the application layer
Segment is a collection of bytes
Connection Oriented
Reliability -=> Makes sure that the number of data sent is equal to data received -=> No loss of data
Makes connection before sending the message
Uses 3-way handshaking -=> Makes request, Gets response, Sends data
In-order -=> Message are sent and received in order
Full Duplex
Both can transmit data at the same time
Piggybacking
Uses Go-back-N and selective repeat for sliding window
Error Control
Checksum
Flow Control
Controls the flow of data
Congestion Control
Uses AIMD algorithm to avoid congestion
Multiplexing/De-multiplexing
While sending does many-to-one, and while receiving does one-to-many of multiple data form channel to sender/receiver
Header
Source/Destination port
Port of the application of sender/receiver
Possible ports = 0 to 65535
Well known port numbers = 0 to 1023
HTTP = 80
SMTP = 25
FTP = 21
Sequence number
Number given to each byte in the segment
Generally TCP uses random sequence number -=> Starts from a random number
Acknowledgement number
Next expected byte number
If the senders byte number is "x" then receiver sends the Acknowledgement "x+1"
Header Length (HLEN)
Maximum bit can be (1111) = 15 -=> 15 x 4 = 60
Minimum can be (0101) = 5
We multiply by 4 -=> Minimum should be 20
Flags
URG (Urgent) -=> If data is urgent then bit value is 1
ACK (Acknowledgement) -=> If data is acknowledgement then bit value is 1
PSH (Push) -=> Buffer (Storing data before sending) is not created
RST (Reset) -=> Resetting the connection
SYN (Synchronization) -=> First byte when making connection
FIN (Finish) -=> Last byte, Connection terminated
Window Size
Receiving window -=> Maximum size (Total capacity) of data that can be received
Checksum
Urgent pointer
Range of data (Bytes) that is urgent in the segment