out-of-band data
DESCRIPTION
Out-of-Band Data. Chap 24. TCP OOB concepts Notification SIGURG signal Exception ready Position of OOB byte Value of OOB byte. TCP Urgent Mode and Socket OOB Data. write(fd,…); write(fd, …) send(fd, “a”, … , MSG_OOB); write(fd, …);. handler(){ recv(fd,…, MSG_OOB); }. - PowerPoint PPT PresentationTRANSCRIPT
Out-of-Band DataOut-of-Band Data
Chap 24
TCP Urgent Mode and Socket OOB DataTCP Urgent Mode and Socket OOB Data
TCP OOB concepts Notification
SIGURG signal Exception ready
Position of OOB byte Value of OOB byte
TCP(sender)
TCP(receiver)
a
a
a
OOB mark
send bufferreceive buffer
OOB buffer (1Byte)
write(fd,…);write(fd, …)send(fd, “a”, … , MSG_OOB);write(fd, …);
select(…, xset, …);…recv(fd,…, MSG_OOB);
handler(){ recv(fd,…, MSG_OOB);}
SIGURG Socket API
Sending TCP OOB dataSending TCP OOB data TCP Sender
OOB data 는 socket send buffer 의 맨 뒤에 append되고 urgent offset 이 그 다음을 가리킨다 . Urgent offset 바로 앞 byte 가 OOB byte 가 된다 .
Normal data 와 순서대로 전송된다 . (normal data 에 우선적으로 전송되지 않는다 ) not true out-of-band data (expedited data)
Enter Urgent mode: Flow control 에 의해 segment 전송이 stop 되더라도 (i.e. receiver 의 socket receive buffer 가 full 일 때 ), urgent notification (URG segment with no data) 은 항상 전송된다 . 그러나 아직 OOB data 는 전송되지 못했을 수 있음 .
OOB data sender send(fd, “a”, 1, MSG_OOB); send(fd, “abc”, 3, MSG_OOB);
Which is the OOB byte?
Receiving TCP OOB Data (1)Receiving TCP OOB Data (1)
TCP Receiver URG segment 가 도착하면 , urgent notification 을
receiver 에게 알려준다 . SIGURG signal is delivered Exception set becomes ready (in case of select) 그러나 , OOB byte 가 도착하지 않았을 수도 있다 . Why?
Read() 는 OOB byte 바로 전 normal data 까지 읽는다 .
Receiver 도 sockatmark() 를 이용하여 OOB byte 를 읽을 차례인지 알수 있다 . OOB 는 end-of-record mark 로 쓸 수 있다 .
Then, receive OOB datarecv(fd, &buff, sizeof(buff), MSG_OOB);
OOB byte 를 가져가기 전에 새로운 OOB byte 가 도착하면 overwrite 되고 OOB mark 도 갱신된다 .
Receiving TCP OOB Data (2)Receiving TCP OOB Data (2)
OOB data receiver Notification of URG segment by means of
SIGURG signal sent to owner of the socket select with exception set notify 되었다고 해서 반드시 OOB data 가 도착한 것은 아
님 . 즉 socket receive buffer 가 full 이어서 OOB byte 가 도착 못할 수 있음 .
Then, receive OOB datarecv(fd, &buff, sizeof(buff), MSG_OOB); OOB byte 를 정확히 수신하고자 하면 , OOB data 가
도착했는지 ( 즉 , out-of-band mark 에 있는지 ) 확인하고 , 도착하지 않았으면 , normal data 를 읽어들여 flow control 이 stop 된 것을 해지하고 다시 확인 필요
단지 exception 이 발생했는지 여부를 알고자 하면 OOB notification 받은 것으로 충분 ( 예 , rlogin)
URG Notification: URG segment receivedURG Notification: URG segment receivedBy exception ready: oob/tcprecv03By SIGURG: oob/tcprecv01
Receiving OOB data with inlineReceiving OOB data with inline
Set inline mode: OOB byte 도 normal data 처럼 read 가능하게 됨
check out-of-band mark and receive OOB data
oob/tcprecv04