Modules 14-15 Network Application Communications Flashcards
Why the “layer” approach to the network model?W
Seperation : Breaking a bigger task (data communication) into smaller tasks (functions)
Abstraction: Changes to one layer minimizes the impact on other layers
Design: Easier to implement functions/protocols as long as interconnection between layers are kept intact.
Complexity: easier to learn, troubleshoot and standardize.
What is the role of the transport layer? Example?
The transport layer is responsible for logical communications between applications running on different hosts.
This may include services such as establishing a temporary session between two hosts and the reliable transmission of information for an application.
How does the transport layer establish connection?
A process server, runs on a server machine, acts as a proxy (on behalf of another), then listens to connect requests, whenever a request arrives, it spawns the requested server allowing it to inherit the connection.
Which transport layer ports do we have? What are their ranges?
Well-known ports (0-1023): used by servers (web,email,dns)
Registered ports( 1024-49151) : assigned by IANA to a requested entity, but not controlled; used by client applications.
Private and/or dynamic ports (49152-65535): assigned dynamically by the client OS to identify an application / service end-point.
What do we need to distinguish communication processes from each other?
- Source port: selected dynamically (OS), used as return address
- Destination port ( e.g Port 80 for HTTP)
- Source Ip address (eg. 192.168.1.5)
- Destination Ip address ( e.g. 192.168.1.1)
- Protocol ( e.g TCP or UDP)
Explain a socket and socket pairs
Socket:
One end-point to a two-way communication 192.168.1.1:10
Socket Pairs: Two ends of the communication (local and remote)
What are the most common transport protocols? And what are their properties?
TCP UDP and QUIC
What is User Datagram Protocol (UDP) ? And where can we use it?
UDP does not track information sent or received and is known as a stateless protocol. It also does not have a flow control and has no acknowledgment that the data is received at the destination. It does also not require an established connection which means that it is not reliable. But it can process UDP datagrams faster than TCP segments.
UDP is used for live media streaming, DNS, SNMP, DHCP, VoIP, online games, IPTV because it is faster.
What is Transmission Control Protocol (TCP)
TCP is the reliable, full-featured transport layer protocol. This is because it ensures that all of the data arrives at the destination, by including fields that ensure the delivery of application data. These fields require additional processing by the sending and receiving hosts.
Also implements flow control and congestion control.
What are the most important TCP header fields according to the slides?
Sequence number. A 32-bit field is used for data reassembly purposes.
Acknowledgment Number: A 32-bit field is used to indicate that data has been received and the next byte expected from the source.
Header Length: A 4-bit field known as ʺdata offsetʺ that indicates the length of the TCP segment header.
Window size: A 16-bit field is used to indicate the number of bytes that can be accepted at one time.
Window: the number of bytes the receiver is willing to receive (receiver advertised window)
Checksum A 16-bit field used for error checking of the segment header and data.
TCP flags:
- SYN (establish), ACK
(acknowledge), RST (reset), FIN
(terminate)
- URG and PUSH flags are rarely
used!
How does TCP establish connection?
TCP uses a method called 3-way-handshake
- SYN The initiating client requests a client-to-server communication session with the server by sending a SYN request to the server.
2.SYN, ACKThe server acknowledges the client-to-server communication and requests a server-to-client communication session. The server sends ACK response and SYN requests to the client.
3.ACK The initiating client acknowledges the server-to-client communication session.
The client sends ACK response to B
How does TCP terminate a connection?
4 way handshake
- FIN, When the client has no more data to send in the stream, it sends a segment with the FIN flag set to the server.
2.ACK, The server sends an ACK to acknowledge the receipt of the FIN to terminate the session from client to server.
3.The server sends a FIN to the client to terminate the server-to-client session.
4.The client responds with an ACK to acknowledge the FIN from the server
In which order must the data stream and packets/segments come? How is this possible?
The TCP data stream can only be pushed to the application layer buffer in-order.
The TCP packets/segments in the stream however can arrive out of order. If they take different routines in the network or due to parallelism in the routers.
This is possible because the usage of sequence numbers allows re-assembly of the data stream at the receiver side even in presence of out-of-order segments. These sequence numbers are randomly selected upon TCP (SYN, SYN/ACK) connection and are incremented further as data is being transmitted by the sender.
What is the acknowledgment number and what is a Duplicate Acknowledgment number?
Acknowledgment number is a 32 bit field in the header. This is used to indicate that data has been received and the next byte expected from the source.
It does this by sending back ACK packets(DELAYED 500ms RFC 1122 200ms Windows) from the receiver to sender when the data has been received.
The receiver can also send something called a Duplicate ACK(NOT DELAYED). This happends when the receiver sees a gap between received segments. And after 3 DupACKs the sender retransmits the missing segment.
ACK packets are unreliable (less costly to drop than data packets)
Why is timeout important in TCP error control?
Timeout is important in TCP error control because we have something called Retransmission Timeout. RTO
Retransmission timeout makes it so that when a packet fails to be delivered, there is a timeout that waits to check if it is delivered. If not deliver the packet is retransmitted to the receiver.
Why is it difficult to determine the right RTO value?
If its too long, it will become to slow to detect a loss, but if its too short we are at risk of getting false positives.
What is congestion on a network? What does it result?
Reduced quality of service occurs when a network node or link carries more data than it can handle. this results in packets being discarded by the overloaded router.
When packets containing TCP segments do not reach their destination, they are left unacknowledged.
Retransmission of lost TCP is also an occurrence, and if the retransmission is not properly controlled, the additional retransmission of the TCP segments makes the congestion even worse.
How can we avoid congestion on a network?
Using flow control
If the source determines that the TCP segments are either not being acknowledged or not acknowledged in a timely manner, then it can reduce the number of bytes it sends before receiving an acknowledgment.
What is a Congestion Window (cwnd) where does it start? And how does it work?
What is SStresh?
The number of bytes TCP sender can inject into the netwrok before expecting to receive an ACK.
Starts with 3 or 10 packets
Then it probes for the available bandwidth in slow -start mode (exponential growth, binary search)
TCP leaves slow-start(SS) mode to Congestion Avoidance (CA) mode after it reaches SSThresh value(Largest possible advertised window)
What is Stream Constrol Transmission Protocol(SCTP)
A message-oriented data transfer protocol that has reliable delivery, congestion control and is connection-oriented.
It has a 4-way handshake with the exchange of cookies
INIT, INIT-ACK, Cookie-Echo Cookie-ACK