Transport LAYER Flashcards
What is a socket used for
Analogous to a door, used to identify which application to the network data belongs to
What information is stored in a socket
The 5 tuple, local IP,remote IP ,local port ,remote port ,protocol
Differences between tcp and udp
TCP is connection oriented, udp is connection less
TCP has Additional features, udp is lightweight
TCP has error recovery, udp does not
Because tcp has error recovery and retransmits, it is known as reliable while udp is unreliable
TCP has windowing flow control, udp does not
Udp sounds a bit trash, what’s it even used for
Udp is great for video streaming and phone calls
In tcp what’s the three way handshake
The client sends a tcp segment with the flag SYN, short for synchronise with me, the server can then decide if it wants to participate in the connection or not, if it does it’ll send a tcp segment back with the ACK and SYN flags set, then the client sends back a segment with the ACK flag set.
The three way handshake is used to start a connection
What are the steps for closing a connection in tcp the main way
Client or server can start the process.
Either first sends a segment with the FIN, short for finish and ACK flags set. The other then sends back a segment with the ACK flag set. Then it sends a segment with the same FIN and ACK flags set. The other then responds with a segment with the ACK flag set.
What’s the other way to close a tcp connnection
Either the client or server will send a segment with the RST flag set, which is short for RESET. This will close the connection completely. This message is usually sent when something has gone wrong and is good when troubleshooting
ISN
Initial sequence number, in the first SYN segment, this is set to a random number at the start of the tcp connection
What is the window size
The amount of data an application can send before it needs an acknowledgement
How is it possible for UDP to be reliable?
If the application which uses it implements its own reliability measures such as acknowledgments and timers etc
How is a checksum calculated?
The sender will computer the checksum as the binary addition of the bit chunks it is sending. After this, the sender takes the 1’s compliment of this number (XOR operation changing zeroes to ones and ones to zeroes). The result is the checksum
How does a receiver validate data using the checksum?
The receiver after receiving all the data blocks sums up the chunks of bits and checksum. If the result is all 1’s, the data is validated and there is no bit loss. Otherwise, it rejects the packet
What is a NACK protocol?
NACK *(Negative Acknowledgment) is when a receiver only sends an ACK when a packet has not been received.
Example packet loss of x is only detected when packet x+1 is received
Disadvantage of NACK
If packet x is lost and the transmission time of data between a sender and receiver is very large, it will take some time before packet x is received again
Advantage of NACK
If the connection and transmission of data between a sender and receiver is very reliable, there is no need for acknowledgment, compared with normal acknowledgment. Can speed things up
What are the two error recovery strategies in a TCP connection?
Go back N and Selective Repeat
Which error recovery strategy used in TCP is more efficient on network bandwidth?
Selective repeat because it only re-transmits messages that have been lost at the receiver
Go back N sends the first message that was lost and then re-transmits all subsequent messages, without any regard for whether the receiver has actually received these messages
What is the Bandwidth Delay Product and how is it calculated?
A measure of how many bits can fill up a network link. It gives the maximum amount of data that can be transmitted by the sender at a given time before waiting for acknowledgment.
= Round Trip Delay (RTT in seconds) x Link Capacity of the Channel (bits/second)