Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring 20061 CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science.

Slides:



Advertisements
Similar presentations
Review: Name/Address conversion: –What does the domain name system do? –Which system calls use the domain name system? –How does it work? –How does getservbyname.
Advertisements

Umut Girit  One of the core members of the Internet Protocol Suite, the set of network protocols used for the Internet. With UDP, computer.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Chap 1 Foundation Out-of-Band Data Chap 24.
UDP & TCP Where would we be without them!. UDP User Datagram Protocol.
1 TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
5/6/2015© 2010 Raymond P. Jefferis IIILect Transport Layer.
Provides a reliable unicast end-to-end byte stream over an unreliable internetwork.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
TCP/IP Protocol Suite 1 Chapter 13 Upon completion you will be able to: Stream Control Transmission Protocol Be able to name and understand the services.
Elementary TCP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Madhusudhan Shyamlal CISC 856 Computer & Information Sciences Thanks to Dr.Paul Amer Nasif Ekiz Ertugrul Yilmaz.
TCP© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
EEC-484/584 Computer Networks Lecture 15 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
CSCI 4550/8556 Computer Networks Comer, Chapter 3: Network Programming and Applications.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
CSCE 515: Computer Network Programming TCP Details Wenyuan Xu Department of Computer Science and Engineering.
Client Server Design Alternatives© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid.
© 2007 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.1 Computer Networks and Internets with Internet Applications, 4e By Douglas.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Computer Network Architecture and Programming
20101 The Data Link Layer Chapter Design Issues Controls communication between 2 machines directly connected by “wire”-like link Services Provided.
Advanced UDP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
WXES2106 Network Technology Semester /2005 Chapter 8 Intermediate TCP CCNA2: Module 10.
UDP© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department.
Gursharan Singh Tatla Transport Layer 16-May
Elementary UDP Sockets© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer.
Chapter 17 Networking Dave Bremer Otago Polytechnic, N.Z. ©2008, Prentice Hall Operating Systems: Internals and Design Principles, 6/E William Stallings.
Signal-Driven I/O Concepts and steps for using signal-driven I/O
6.1. Transport Control Protocol (TCP) It is the most widely used transport protocol in the world. Provides reliable end to end connection between two hosts.
Introduction to Networks CS587x Lecture 1 Department of Computer Science Iowa State University.
TCP Lecture 13 November 13, TCP Background Transmission Control Protocol (TCP) TCP provides much of the functionality that IP lacks: reliable service.
University of the Western Cape Chapter 12: The Transport Layer.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Transmission Control Protocol
Chapter 12 Transmission Control Protocol (TCP)
McGraw-Hill©The McGraw-Hill Companies, Inc., 2000 Transmission Control Protocol (TCP)
Chapter 2 Applications and Layered Architectures Sockets.
2.8. Data Communication The data that flows on a connection may be thought of as a stream of octets. The sending user indicates in each SEND call whether.
Networking Basics CCNA 1 Chapter 11.
TELE 402 Lecture 12: Signal-Driven I/O & Raw Socket 1 Overview Last Lecture –Advanced UDP sockets and threads –Source: Chapters 22&26 of Stevens’ book.
Computer Networks23-1 PART 5 Transport Layer. Computer Networks23-2 Position of Transport Layer Responsible for the delivery of a message from one process.
1 Socket Options getsockopt and setsockopt functions Check options and obtain default values Generic socket options IPv4 socket options IPv6 socket options.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
Hour 6 The Transport Layer 1. What You'll Learn in This Hour Connections oriented and connectionless protocols Ports and sockets TCP UDP 2.
Firewalls A brief introduction to firewalls. What does a Firewall do? Firewalls are essential tools in managing and controlling network traffic Firewalls.
Telnet  TErminaL NETwork  TELNET is a general-purpose client-server application program  TELNET enables the establishment of a connection to a remote.
4343 X2 – The Transport Layer Tanenbaum Ch.6.
1 Computer Communication & Networks Lecture 23 & 24 Transport Layer: UDP and TCP Waleed Ejaz
Data Communications and Networks Chapter 6 – IP, UDP and TCP ICT-BVF8.1- Data Communications and Network Trainer: Dr. Abbes Sebihi.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
1 Transmission Control Protocol (TCP) RFC: Introduction The TCP is intended to provide a reliable process-to-process communication service in a.
Chapter 9: Transport Layer
Fast Retransmit For sliding windows flow control we waited for a timer to expire before beginning retransmission of a packet TCP uses an additional mechanism.
Instructor Materials Chapter 9: Transport Layer
5. End-to-end protocols (part 1)
Chapter 17 and 18: TCP is connection oriented
Transport Layer.
Process-to-Process Delivery, TCP and UDP protocols
TCP.
PART 5 Transport Layer Computer Networks.
CIS 321 Data Communications & Networking
TCP - Part I Karim El Defrawy
CS4470 Computer Networking Protocols
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Protocols: TCP Segments, Flow control and Connection Setup
Transport Layer 9/22/2019.
Presentation transcript:

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring CS4254 Computer Network Architecture and Programming Dr. Ayman A. Abdel-Hamid Computer Science Department Virginia Tech Out-Of-Band Data

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring Outline Out-of-Band Data (Chapter 24)  Introduction  TCP Out-of-Band Data  sockatmark Function  Examples

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring Introduction Out-of-band data  Expedited data  Notification should be sent before any normal (in- band) data that is already queued to be sent  Higher priority than normal data  Out-of-band data mapped onto existing connection (instead of using two connections) UDP has no implementation of out-of-band data TCP has its own flavor of out-of-band data

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring TCP Out-of-Band Data 1/5 TCP does not have a true out-of-band data mode TCP provides an urgent mode N bytes in TCP socket send buffer Process writes a single byte of out-of-band data send (fd,”a”,1,MSG_OOB); 1N First byte to send last byte to send Socket send buffer 1NOOB Socket send buffer First byte to send last byte to send TCP Urgent Pointer

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring TCP Out-of-Band Data 2/5 Next segment sent by TCP will have URG flag set in TCP header Urgent offset in TCP header points to byte following the out-of-band byte  Add urgent offset to sequence number field to obtain value of urgent pointer Segment may or may not contain the byte labeled as OOB Depends on number of bytes ahead of it, segment size, and current receiver window 1N First byte to send last byte to send Socket send buffer 1NOOB Socket send buffer First byte to send last byte to send TCP Urgent Pointer

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring TCP Out-of-Band Data 3/5 TCP header indicates that sender has entered urgent mode (actual byte of data referred to by urgent pointer need not be sent) IF sending TCP is stopped by flow control  Urgent notification is sent without any data  One of the reasons why applications use TCP’s urgent mode If multiple bytes are sent out-of-band  send (fd,”abc”,3,MSG_OOB);  Urgent pointer points one beyond the final byte  last byte is considered the out-of-band byte

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring TCP Out-of-Band Data 4/5 Receiver’s response to out-of-band data  TCP Checks urgent pointer to see if it refers to new out-of- band data (TCP can send multiple segments containing URG flag, but referring to same byte of data)  Only first segment causes receiving process to be notified  SIGURG signal delivered to socket owner  If process blocked in a call to select (waiting for an exception condition), select returns  Only one OOB mark, if a new OOB byte arrives before old is read, old byte is discarded

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring TCP Out-of-Band Data 5/5 Receiver’s response to out-of-band data  Actual OOB byte can be pulled out-of-band or left inline  SO_OOBINLINE socket option (by default not set) Byte not placed in socket receive buffer Byte placed into a separate one-byte out-of-band buffer for this connection To read from that buffer, use recv and specify MSG_OOB flag  If SO_OOBINLINE socket option is set Byte left in normal socket receive buffer Process knows when it reaches this byte of data by checking the out-of-band mark for this connection

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring Simple TCP OOB Data Example 1/2 Handles SIGURG scenario Source code in oob/tcpsend01.c and oob/tcprecv01.c Nine bytes are sent, with a one-second sleep between each output operation Receiver establishes signal handler for SIGURG, and uses fnctl function to set the owner of the connected socket  F_SETOWN command sets the socket owner (the process ID to receive SIGURG (see section 7.11))  SIGURG (and SIGIO ) are generated for a socket only if the socket has been assigned an owner  When a new socket created by calling socket, it has no owner  When a new socket created from listening socket  Socket owner inherited from listening socket by connected socket

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring Simple TCP OOB Data Example 2/2 Handles select scenario (Could be a Problem) source code in oob/tcprecv02.c  select indicates an exception condition until the process reads beyond the out-of-band data  Can not read the out-of-band data more than once  After first read, kernel clears the one-byte out-of-band buffer  When call recv with MSG_OOB flag the second time, it returns EINVAL  The problem is reproducible on Solaris platforms, not on Linux platforms. Attempted on (SunOS 5.9 Generic_ sun4u sparc SUNW,Sun-Blade-1000) and (Linux _FC4smp #1 SMP i686 i686 i386 GNU/Linux) Correct source code in oob/tcprecv03.c  select for an exception condition only after reading normal data

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring sockatmark Function Associated out-of-band mark, when out-of-band data is received –Position in normal stream of data at the sender, when sending process sent out-of-band byte Determined by calling sockatmark function #include int sockatmark (int sockfd) //Returns: 1 if at out-of-band mark, 0 if not at mark, -1 on error Out-of-band mark applies regardless of whether receiving process is receiving OOB data inline or out-of-band

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring sockatmark Function Example Source code in oob/tcpsend04.c and oob/tcprecv04.c Call sockatmark to determine when out-of-band byte is encountered Out-of-band marks always points one beyond the final byte of normal data  If received inline  sockatmark returns 1 if next byte to be read is the byte sent with MSG_OOB flag  If received out-of-band  sockatmark returns 1 if next byte to be read is the first byte that was sent following the out-of- band A read operation stops at the out-of-band mark Try this example on lab machines (Linux)  what do you conclude? Modify this example to receive out-of-band not inline

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring Another OOB Example 1/2 Illustrates two features  TCP sends notification of OOB data, even though it is stopped by flow control from sending data  A receiving process can be notified about OOB data before the OOB data arrives! Source code in oob/tcpsend05.c and oob/tcprecv05.c  Sending process sets the size of socket send buffer to 32,768, writes 16,384 bytes of normal data, and then sleeps for 5 seconds  Receiver sets socket receive buffer to 4,096 bytes  What will happen?  Sender sends 1 byte of OOB data, followed by 1,024 bytes of normal data, and terminates

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring Another OOB Example 2/2 SIGURG signal is caught –OOB data was detected and receiving process notified Receiver calls recv specifying MSG_OOB flag OOB byte not available to be read (since it was not transmitted yet) –generate EWOULDBLOCK error – recv error: Resource temporarily unavailable

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring Yet Another OOB Example Only one OOB mark for a given TCP connection If new OOB data arrives before the receiving process reads existing OOB data, previous mark lost Source code in oob/tcpsend06.c and oob/tcprecv06.c Arrival of second OOB byte overwrites the mark stored when first OOB byte arrived

Out-of-Band Data© Dr. Ayman Abdel-Hamid, CS4254 Spring TCP OOB Data Recap OOB data conveys 3 different pieces of information to receiver  Sender went into urgent mode (notification transmitted immediately after sender sends OOB byte)  Existence of an OOB mark  Actual value of OOB byte  Usefulness of OOB data depends on why it is being used by the application  Special mode of processing for any data it receives after the OOB  Discard all data up to the OOB mark