개발자 끄적끄적
컴퓨터 네트워크(2023.10.25) 본문
<Flow Control>
- Flow control at the data link layer
- The date-link layer at the sending node tries to push frames toward the data-link layer at the receving node
- If the receving noce can not process and deliver the packet to its network at the same rate
that the frames arrive, it becomes overwhelmed with frames
- Buffers(완충기)
- One of the solutions is to use two buffers;
one at the sending data-link layer and the other at the receving data-link layer
- When the buffer of the receving data-link layer is full, it informs the sending data-link layer to stop pushing frames
Q. sending DL layer에서도 buffer가 필요한 이유
- 수신되는 패킷이 송신기에서 같은 속도로 송신하지 못하면 프레임들이 수신기에서 쌓이게되고 딜레이되기 때문
<Connection>
- A Data Link Control protocol can be either connectionless or connection-oriented
- Connectionless protocol(ex: Ethernet)
- Frames are sent from one node to the next without any relationship between the frames
- The frames are not numbered and there is no sense of ordering
- 아무런 조취없이 다음 노드로 보내는 것, 프레임의 번호가 없다 -> 전달되는 순서도 없다
- Connection oriented protocol
- A logical connection should first be established between the two nodes
- The frames are numbered and sent in order
- 프레임(frame)을 보낼 때 먼저 Connection을 만들어 놓고 보내는 것, 프레임에 번호가 존재 -> 순서가 존재
<Error control(오류제어)>
- Error control at the data link layer
- a CRC is added to the frame header by the sender and checked by the receiver
1. If the frame is corrupted, it is silenty discarded. If not corrupted, the packet is delivered to the network layer(ex: Ethernet)
- error가 있으면 버리고, error가 없으면 packet부분만 올린다
2. If the frame is corrupted, it is silentyl discarded. If not corrupted, an(positive) and acknowledgment(수신확인) is sent.(And the packet is delivered to the network layer)
- error가 없으면 잘 받았다고 ACK을 송신측에 보내준다
- Combination of flow and error control
- The acknowledgment can be used for 'the flow control' and 'error control'
- A frame carries an acknowledgement(수신확인) is called ACK to distinguish it from the data frame
Q. ACK의 두 가지 기능
- error가 없으면 잘 받았다고(positive) ack를 송신측에 보내줌으로서 수신확인의 기능
- flow control과 error control를 동시에 처리할 수 있다
<Data link layer protocols for flow & error control>
- Simple
- Stop-and-Wait ☆
- Go-Back-N ☆
- Selective-Repeat ☆
- Although the first two protocol still are used at the data-link layer, the last two have disappeared
<Simple Protocol>
- Our first protocol is a simple protocol with neither flow nor error control
<Stop-and-Wait Protocol>
- It supports both flow and error control
- The sender sends one frame at a time and waits for an ACK before sending the next one
- To detect corrupted frames, we need to add a CRC to each data frame
- ACK frame안에도 CRC가 존재
- 송신기는 프레임을 보낼 때 Timer를 가동한다(ex: 10초동안)
- 10초동안 ACK가 수신이 안되면 잘못(lost or error 발생 or ACK가 lost, ACK의 CRC체크를 해봤는데 error)됐다고 판단
Q. Time-out이 발생하는 경우, 4가지 -> Time-out이 발생되면 재전송(복사본을 메모리에 저장)
1. frame lost
2. frame error
3. ACK가 lost
4. ACK에 CRC 체크를 해봤는데 error
<Sliding window Protocol>
- frame sequence 번호가 0~7까지 존재 : 8가지, frame은 한 번에 1개 이상씩 보낼 수 있다
- window size는 0~6까지 존재 : 7가지
- 송신(가능) window seq.no : 전송되었으나 아직 확인 신호를 받지 못한 frame 번호들
- 수신(가능) window seq.no : 수신 가능한 frame 번호
- 송수신측의 window size가 너무 크면, 송신측에서 old frame들을 재송신할 경우 수신측은 새로운 것인지 옛 것인지 구분하지 못한다
- 최대 window size는 sequence number의 1/2이 적당
- piggyback으로 ack를 할 수 없을 때(즉, reverse link의 data가 없을 때) ack timer를 동작시키고
일정시간내에 reverse data가 없음녀 ack 전용 frame을 보낸다
- 송신기의 data frame timer보다 수신기의 ack timer가 짧아야한다
Q. 가능한 최대 window size는?
-> sequence number의 1/2
<Go-back-n Protocol>
- error난 frame과 이후의 모든 frame을 재전송
- receiver window size = 1, 항상 한개씩만 받게 된다(수신기의 memory size = 1)
- 통신 BW(bandwidth)가 크고 memory가 비쌀 경우 -> 수신기쪽의 memory가 작을 때
- 송신기에 buffer memory가 필요(송신기 window size > 1)
<Selective repeat protocol>
- error난 frame만 재전송 -> 통신비용 저렴
- 수신기 window size > 1
- 송수신기에 buffer memory 필요
<Piggybacking>
- data를 보낼 때 ack도 함게 보낸다
- data가 없을 때는 ack만 보낸다
<Two DLC Protocol>
- High-Level Data-Link Control : base of many protocols that have been designed for LANs
- Point-to-Point Protocol
<HDLC>
- High-level Data Link Control(HDLC) is bit-oriented protocol for communication over point-to-point and multipoint links
- It implement the Stop-and-Wait protocol
- basis for other practical protocols such as PPP(Point-to-Point), Ethernet, or wireless LANs(무선랜 프로토콜)
- Transfer Modes(두가지 모드의 전달모드)
- normal response mode(NRM)
- asynchronous balanced mode(ABM)
Q. HDLC에 대해서 설명
Stop-and-Wait protocol이고, PPP, Ethernet, 무선랜 프로토콜에 이용한다. 두가지의 전달모드가 있는데 NRM와 ABM이 있다
<Normal response mode>
- Point-to-point
- 하나의 primary(master)와 secondary(slave)는 하나가 존재
- primary가 먼저 command를 보내고 수신한 secondary는 response를 보낸다
- Multipoint
- 하나의 primary(master)와 secondary(slave)는 하나 이상이 존재
- primary가 먼저 command를 보내고 수신한 secondary는 response를 보낸다
- The station cofiguration is unbalanced(primary(master) - secondary(slave))
- One primary station and multiple secondary stations
- Primary station can send commands; a secondary station can only respond
<Asynchronous balanced mode>
- Combined(primary/secondary) -> Command/response
- The configuration is balanced
- The link is point-to-point, and each station can function as a primary and secondary(acting as peers)
- This is the common mode today
<Framing>
- HDLC defines three types of frames
- information frmaes(I-frames) : user data, control information(ack) relating to user data(piggy backing)
<- Flag/Address/Control/User Information/FCS/Flag //개개인을 field라고 부른다
- supervisory frames(S-frames) : Control information(ack), data가 없다
<- Flag/Address/Control/FCS/Flag
- unnumbered frames(U-frames) : System management, 제어를 하기위한 데이터가 들어가있다(User data를 보낼 수 있도록 네트워크 장비를 제어하기위한 데이터가 들어있다)
<- Flag/Address/Control/Management information/FCS/Flag
<Field>
1. Flag field : frame의 시작과 끝을 알려준다
- Synchronization pattern : 0111 1110
2. Address field
- The address of the secondary station
3. Control field
- 1 or 2 byte
- Flow and error control
4. Information field
- User's data from the network layer or management information
5. Frame Check Sequence(FCS) field
- 2 or 4 byte CRC code for error detection
<Control field format for the different frame types>
- Control field for I-frames
- N(S) : 3bit에 내가 보낼 sequence no. of the frame. N(R) : ACK no. with piggyback
- P/F : When it is set, it means poll or final
- Control field for S-frames
- N(R) : ACK no(내가 0번을 받았으니 1번을 보내줘). or NAK(negative) no
- Code : define the type of S-frame
- 00 : Receive Ready(RR) : no error reception(송신기가 수신기에게 알려줌)
- 10 : Receive Not Ready(RNR) : no error reception & busy(나중에 보내)
- 01 : Reject(REJ) : NAK
- 11 : Selective Reject(SREJ) : NAK for selective repeat ARQ
- Control field for U-frames
- The 5 bits code define the type of U frames
<PPP(Point-to-Point Protocol)>
- Service
- It provides network address configuration
- No flow control/sequence no./error control
- Frame format
- PPP uses a character-oriented(or byte-oriented) frame
<- Flag(1 byte)/Address(1 byte)/Control(1 byte)/Protocol(1/2 bytes)/Payload(Variable)/FCS(2/4 bytes)/Flag(1 byte)
*FCS : error가 있으면 재전송요구
<PPP protocols - Link Control Protocol(LCP)>
- Establishing, maintaining, configuration, and terminating links
- Negotiation to set options
<- Flag/Address/Control/Code(ex.0xC021)/Payload(and padding)/FCS/Flag
LCP packet(Payload) : Code(1)/ID(1)/Length(2)/Information(Variable) 이 중 header는 code, Id, length
<Transition Phases>
Start -> Dead <- Carrier(반송파) detection failed
<PPP protocols - Authentication Protocol(AP)>
1. Password Authentication Protocol(PAP)
1) The user sends the user name and a password
2) The system checks them and either accepts or denies connection
2. Challenge Handshake Authentication Protocol(CHAP)
1) The system sends the user a challenge(문제를 낸다) packet containing a challenge value
2) The user generate a result using the challange value and password, and sends it to the system
3) The system also calculate the result, and compares it with user's. If they are same, then access is granted
<PPP protocols - Network Control Protocol(NCP)>
- Internet Protocol Control Protocol(IPCP) : 인터넷통신을 하기 위한 준비과정 프로토콜
->Flag/Address/Control/0x8021/Payload(and padding)/FCS/Flag
IPCP packet : Code/ID/Length/IPCP Information(Variable)
<IP datagram encapsulated in a PPP frame>
->Flag/Address/Control/0x0021/Payload(and padding)/FCS/Flag
- IP packet(L3) : Header/User data(L4)
<Multilink PPP>
- A logical PPP frame is divided into several PPP frames
- Need sequence no
'컴퓨터 네트워크' 카테고리의 다른 글
Data link layer(2023.10.31) (0) | 2023.11.05 |
---|---|
컴퓨터 네트워크(2023.9.26) (0) | 2023.09.27 |
컴퓨터 네트워크(2023.9.20) (0) | 2023.09.20 |