Interview_TCP/UDP
π UDP
β What is UDP?
- User Datagram Protocol- conectionless
- unreliable
- check just data error with checksum
β What are the benefits of UDP? and the disadvantages?
ππ» fastππ» less overhead
ππ» 1:1, 1:N, N:N connection possible
ππ» packet loss, corruption
ππ» data can be recieved in different order
β What is UDP checksum?
- to check data error- send data with checksum header
- divide segment into 16bits
- add all, add 1, create checksum
- send data with checksum
- reciever also creates checksum for recieved data
- if it matches, no error
- if doesnt match, error in segment!
β Where is UDP used?
- DNS- SNMP
- RPC, NetBios, syslog, Kerberos, TFTP
- streaming, internet calls
- allow little data loss
- need to send fast
β How is UDP connection?
- server, client can be connected 1:1, 1:N, N:Nβ What is overhead?
- excess usage of computing resource- such as processing, memory, bandwidth
- extra memory required for supplemental information
- (ex) src to destination
- space eaten up by protocols to acheive certain goal
β What is payload?
- actual data to be transmittedπ μ λ’°μ λ°μ΄ν° μ μ‘
π How can we prevent data loss during transmission?
- ARQ- countdown timer
- sliding window
β How long should be countdown timer?
- more than travel time- more than time reciever needs to manage segment
β What is ARQ?
- Automatic Repeat Request/Query- error checking
- reciever feedback
- sender retransmit
- βοΈ sequence number
- βοΈ countdown timer
- βοΈ sliding window
βοΈ What is stop and wait?
- Send and wait until ACK response from reciever- ππ» reliable, ππ» but slow
β What is pipeline protocol?
- Send packets without waiting for ACK response- ππ» cannot solve data packet loss
- ππ» recieved order might be different
- from HTTP 1.1
βοΈ What is GBN ARQ?
- Go-back-N- send n(window size) packets if not recieved
- sliding window protocol
- cumulative acknowledgement λ΄κ° μ¬κΈ°κΉμ§ λ°μλ€
β What are the benefits, disadvantages of GBN?
- ππ» pipelining- ππ» faster than stop-and-wait
- ππ» send packet multiple times(lost packet + following frames)
βοΈ What is SR?
- selective repeate- only retransmit lost packet
β What is the benefit of SR?
- ππ» pipelining- ππ» send only lost packet
π TCP
β What is TCP?
- Transmission control protocol- Transport layer
- conection oriented
- reliable
β Where is TCP used?
- HTTP- SMTP
- FTP
- SSH
β What is full duplex and point-to-point?
- full duplex: μλ°©ν₯- point-to-point: 2κ°μ μ’ λ¨μ μΌλ‘ μ°κ²°
β How is TCP reliable?
- checksum- ARQ
- timer
- sequence number
β What does it mean to be "reliable"?
- data integrity- data is in the right order
β How is TCP connection-orinted?
- pre-connection process- 3 way handshake
β Explain ACK lost scenario in TCP
- Segment send to reciever, but ACK from reciever to sender was lost- Sender sends again same packet
- Reciever already recieved, throw away
β Explain premature timeout scenario in TCP
- Reciever recieves, sends ACK- However, ACK arrvies later than timeout
- Sender thinks packets didnt arrive, so sends again
β Explain cumulative scenario in TCP
- Sender sent segment 1, 2- Reciever recieved, sent ACK 1, 2
- ACK 1 was lost, ACK 2 arrived
- Sender thinks as ACK 2 arrived, ACK 1 has arrived successfully
- Retransmission of data does not occur
β How can TCP know which segment to send?
- sequence numberβ What are the problems that can occur in TCP?
- packet loss- packet corruption
- reciever overloaded
β How can re realize that a packet is lost?
- timeout- 3 duplicate ACK
β What is 3-way-handshake?
- pre-connection-process- **SYN**
* client: SYN-SENT - **ACK**
* sever: SYN_RCVD - **SYN** * client: ESTABLISHED, sever: ESTABLISHED
β Why not 2-way-handshake?
- server needs to check state of client- μ΄λ΄ λλ μ°κ²°λλ©΄ μλλ€.
- client request is retransmission of timeout
- TCP connection is over
β How can we confirm message was recieved by server?
- with ACK(acknowledgement) message- server replies with ACK message to confirm that server recieved the message
- ACK message is control signal to (1) confirm it recieved message (2) is ready to recieve message
β What is 4-way-handshake?
- To finish connection- FIN
* client: FIN_WAIT
- ACK
* server: CLOSE_WAIT
- FIN
* client: TIMED_WAIT
* server: LAST_ACK
- ACK
* client: CLOSED
* server:CLOSED
β What is fast retransmission in TCP?
- Sender does not wait until timeout- When Sender recieves identical ACKs for three times, retransmits
- 3 duplicate ACK
- fast bc sender does not wait for timeout
β What is flow control?
- prevent reciever recieving too many segments before it could handle- π control speed
π configure sliding window size
π stop and wait
β How does "flow control" control speed?
- take reciever's buffer size into accountπ configure sliding window size
π stop and wait
β What is congestion control?
- prevent too many packets on networkπ AIMD(Additive Increase Multiplicative Decrease)
π slow start
π TCP Tahoe
π TCP RENO
β What happens when network is congested?
- latency- packet loss
TCP π GBN
- 곡ν΅μ : sliding window, sendbase, sequence number- GBN: send n(sliding window size) number of segment
- TCP: send only the missing segment
TCP π SR
- 곡ν΅μ : retransmit only lost segment- SR: each segment has timer
- TCP: single timer
This post is licensed under CC BY 4.0 by the author.