개발자 끄적끄적
컴퓨터 네트워크(2023.12.5) 본문
<Connection>
1. Connectionless
- different paths for different datagrams belonging to the same message
- independency between pakcets
- 패킷사이의 관련성이 없다
2. Connection-oriented
- dependency between packets
- 패킷사이의 관련성이 있다
<Stop-and-Wait Protocol>
- A connection-oriented protocol uses both flow and error control
- The sender sends one packet at a time and waits for an acknowledgement before sending the next one
- To detect corrupted packets, we need to add a checksum to each data packet
- 송신기쪽에서 packet을 보낼 때 Timer를 가동하고 timeout이 되기전 수신기 측에서 ack를 보내면 송신기측에서 packet segment를 보낸다
<Services>
- User Datagram Protocol(UDP)
- Unreliable, connectionless, no error control
- For simple and efficiency
- Transmission Control Protocol
- Reliable, connection oriented
- Stream Control Transmission Protocol
- Combines the features of UDP and TCP
<Some well-kown ports used with UDP and TCP>
1. FTP
- port number : 20, 21
- File Transfer Protocol
2. TELNET
- port number : 23
- Terminal Nerwork
3. DNS
- port number : 53
- Domian Name Service
4. DHCP
- port number : 67
- Dynamic Host Configuration Protocol
5. HTTP
- port number : 80
- Hypertext Transfer Protocol
<UDP>
1. UDP user datagram
- Header(8bytes) + Data
- Header format
- 2byte(16bits)의 Sourceport number(Total length)
- 2byte(16bits)의 Destination port number(Checksum -> 존재하지만 쓰이지는 않는다)
<UDP Services>
- Process-to-process communication
- socket address : IP address + port number
- Connectionless services
- No sequence number, possibly different travel path
- No fragmentation : max 65,507 bytes ((65,545 - 8(UDP header) - 20(IP header))
- Flow control
- No flow control, no window mechanism
- Error control
- No error control except checksum in header(no ack)
- Checksum
- Checksum calculation includes peseudo-header, UDP, header, and data
<Pseudo-header for checksum calculation>
- IP주소까지 함께 계산해서 checksum으로 보내라
- Checksum calculation is optional(선택)
<UDP Applications>
- Simple request-response communication
- Trivial File Transfer Protocol(TFTP)
- Multicasting/broadcasting
- Simple Network Management Protocol(SNMP) -> network장치들의 장비들을 확인 및 설정
- Routing Information Protocol(RIP)
<Transmission Control Protocol(TCP) services>
- Connection oriented & reliable protocol
- Process-to-Process communication using port number
- Stream delivery service -> 끝이 없이 data를 보내는 것
- Sending and receiving buffer for flow and error control
- Segment(자른다) 기능 존재
- Full duplex communication
- Multiplexing and demultiplexing
- Connection oriented service
- Reliable service using acknowledgment
<TCP Features>
- Byte number
- An arbitrary number between 0 and (2^32)-1 for the first byte from the application process
- The sequence number defines the number assigned to the first byte cotained in the segment
<Control field>
- ACK : acknowledgement field의 유효 여부
- PSH : 수신 TCP 계층의 buffer에 저장된 segment를 즉시 응용 계층으로 전달
- RST : 접속 문제 발생 시 강제적으로 해지
- SYN : 접속 설정과정에서 사용
- FIN : 한 쪽의 node가 더 이상 송신할 data가 없을 때
- Window size
- The available window size of the sending TCP in bytes
- Checksum
- Mandatory(의무적) in TCP, but option in the UDP datagram
- Calculation includes pseudo-header and data
<A TCP Connection>
- TCP is connection-oriented
- TCP provides retransmission(재전송) function and reordering(buffer가 존재해서 reordering) cf)IP cannot
- Connection establishment
- Three-way handshaking
1. The server program tells its TCP that it is ready to accept a connection(passive open : 먼저 열어놓고 기다린다)
2. The client program issues a request for an active open
<Rule of ack. response>
1. Rule 1 : The piggyback(data를 받을 때 아까 받은 것에 대한 ack number를 받는 것) should be included
2. Rule 2 : When the receiver has no data to send and has to send an ack., it watis unil another segment arrives or timer expires
3. Rule 3 : When the receiver receives the expected sequenced segment(다음 번 패킷) before sending an ack.
it sends and ack. immediately
4. Rule 4 : When the receiver receives the out-of-order sequenced(순서가 바뀐 패킷) segment, it sends an ack.
with expected sequence number
4. Rule 4 : When the receiver receives the missing segment, it sends an ack. with expected sequence number(수신을 기대하는 packet)
5. Rule 6 : If duplicated segment(중복된 패킷) arrives, the receiver sends and ack.
with expected sequence number(다음번 패킷)
'컴퓨터 네트워크' 카테고리의 다른 글
컴퓨터 네트워크(2023.11.30) (1) | 2023.12.01 |
---|---|
컴퓨터 네트워크(2023.11.29) (0) | 2023.11.30 |
컴퓨터 네크워크(2023.11.24) (1) | 2023.11.26 |