1 / 26

System Programming SOCKETS and TCP, UPD Protocols

System Programming SOCKETS and TCP, UPD Protocols. ISO OSI 7 Layer Network Reference Model. Application. Application. Presentation. Presentation. Session. Session. Transport. Transport. Network. Network. Network. Data Link. Data Link. Data Link. Physical. Physical. Physical.

hu-grimes
Download Presentation

System Programming SOCKETS and TCP, UPD Protocols

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. System ProgrammingSOCKETS and TCP, UPD Protocols

  2. ISO OSI 7 Layer Network Reference Model Application Application Presentation Presentation Session Session Transport Transport Network Network Network Data Link Data Link Data Link Physical Physical Physical Physical Wire Physical Wire Host B Host A Router

  3. TCP UDP TCP UDP TCP/IP Protocol Stack Application Application IPv4, IPv6 IP IPv4, IPv6 Link Link Link Link Physical Wire Physical Wire Host A Host B Router

  4. TCP UDP OSI model and IP suite Comparison Application Application Application Details User Process Presentation Session Sockets XTI Transport Network IPv4, IPv6 Kernel Communications Details Data Link Device drive and Hardware Physical

  5. TCP/IP Protocol Suite

  6. Socket • Socket is an Interface to Network protocol stack • Provide point-to-point, two-way communication between two processes • Versatile and are basic component of inter-process and inter-system communication • Endpoint of communication to which a name can be bound • Exist in communication domains called socket domains • There are twenty three (23) sockets types defined in socket.h • Processes communicate only between sockets of the same type

  7. Socket Types • Stream Socket • Provides two-way, sequenced, reliable, and unduplicated flow of data. • Underlying Protocol is TCP, socket type is SOCK_STREAM • Datagram Socket • Supports a two-way flow of messages • Datagram socket may receive messages in a different order from the sequence in which the messages were sent • Socket type is SOCK_DGRAM • Underlying protocol is User Datagram Protocol (UDP)

  8. Socket Programming • Using sockets to communicate between different process • These processes can be remote or local • Sockets are manipulated like un-buffered I/O files and use socket descriptors • Most popular of APIs for socket programming is Berkeley Sockets • Another popular socket API is the System V Transport Layer Interface (TLI) provided by AT&T later standardized as X/Open Transport Interface

  9. Transport Layer Role and Services The purpose of the Transport layer

  10. Transport Layer Role and Services Major functions of the transport layer and the role it plays in data networks

  11. Transport Layer Role and Services Supporting Reliable Communication

  12. Transport Layer Role and Services The basic characteristics of the UDP and TCP protocols

  13. Transport Layer Role and Services How a port number is represented and describe the role port numbers play in the TCP and UDP protocols

  14. Transport Layer Role and Services

  15. Application and Operation of TCP Mechanisms The role of port numbers in establishing TCP sessions and directing segments to server process

  16. UDP Protocol The process specified by the UDP protocol to reassemble data at the destination device

  17. TCP Connection EstablishmentThree-Way Handshake The server must be prepared to accept connection (passive open) socket, bind, listen The client calls connect (active open) A SYN segment is sent telling the server the initial sequence number of client The server must ACK the clients SYN and also send its own SYN to the client The client must ACK the servers SYN Each SYN can contain TCP options

  18. Three-Way Handshake

  19. TCP Options MSS option With this option the TCP sending the SYN announces its maximum segment size, the maximum amount of data that it is willing to accept in each TCP segment, on this connection Can be set with TCP_MAXSEG socket option

  20. TCP Connection Termination One application calls close first (active close), this end’s TCP sends a FIN segment, which means it is finishes sending the data The other side that receives FIN performs the passive close The receive FIN is acknowledge by TCP The receipt of the FIN is also passed to the application as an end-of-file (after any data that may be queued for the application to receive) Some times later the application that received the end-of-file will close its socket This cause its TCP to send a FIN The TCP on the system that receives this final FIN (the end that did the active close) acknowledges the FIN

  21. TCP Connection Termination

  22. States for TCP

  23. TCP State Transition Diagram 23

  24. Common scenario

  25. MSL is the maximum amount of time that any given IP datagram can live in an internet • The common value for MSL is between 30 seconds to 4 minute 25

More Related