Compiled by: Jayakumar Balasubramanian Web:  http://www.jwritings.com Email:  [email_address]
Transmission Control Protocol (TCP)
The TCP service model <ul><li>Underlying media is ‘unreliable’ </li></ul><ul><li>An ‘end-to-end’ connection oriented, reli...
Transport addressing - Ports
Ports and services  192.18.22.13 Port   80  25  23 Application  WWW  E-mail  Telnet
Ports and services
How does TCP achieve all this? <ul><li>The TCP maintains a method called as ‘three-way-handshake’ for connection establish...
Connection establishment
Connection termination
UDP header
The RAW sockets
How to program RAW sockets? <ul><li>Use simple socket() call with some different parameters </li></ul><ul><li>Creating a R...
Web  :  http://www.jwritings.com Email:  [email_address]
Upcoming SlideShare
Loading in …5
×

Networking chapter VII

597 views

Published on

Chapter VII talks about TCP protocol covering three way handshake and RAW socket programming.

Published in: Technology, Education
  • Be the first to comment

Networking chapter VII

  1. 1. Compiled by: Jayakumar Balasubramanian Web: http://www.jwritings.com Email: [email_address]
  2. 2. Transmission Control Protocol (TCP)
  3. 3. The TCP service model <ul><li>Underlying media is ‘unreliable’ </li></ul><ul><li>An ‘end-to-end’ connection oriented, reliable protocol is required </li></ul><ul><li>TCP functionalities: </li></ul><ul><ul><ul><li>Service mapping based on port numbers </li></ul></ul></ul><ul><ul><ul><li>Congestion control </li></ul></ul></ul><ul><ul><ul><li>Connection establishment and termination </li></ul></ul></ul><ul><ul><ul><li>Acknowledgement </li></ul></ul></ul><ul><ul><ul><li>Timeout and re-transmission </li></ul></ul></ul>
  4. 4. Transport addressing - Ports
  5. 5. Ports and services 192.18.22.13 Port 80 25 23 Application WWW E-mail Telnet
  6. 6. Ports and services
  7. 7. How does TCP achieve all this? <ul><li>The TCP maintains a method called as ‘three-way-handshake’ for connection establishment </li></ul><ul><li>The connection termination also happens in a pre-defined way </li></ul><ul><li>Since both ends know each other, the ‘connectedness’ comes is achieved </li></ul><ul><li>Various flag fields are used: ACK, SYN, RST, FIN </li></ul>
  8. 8. Connection establishment
  9. 9. Connection termination
  10. 10. UDP header
  11. 11. The RAW sockets
  12. 12. How to program RAW sockets? <ul><li>Use simple socket() call with some different parameters </li></ul><ul><li>Creating a RAW socket: </li></ul><ul><ul><ul><li>TCP protocol: IPPROTO_TCP </li></ul></ul></ul><ul><ul><ul><li>UCP protocol: IPPROTO_UDP </li></ul></ul></ul><ul><ul><li>socket (AF_INET,SOCK_DGRAM,IPPROTO_IP) </li></ul></ul><ul><li>Sending and receiving data: </li></ul><ul><ul><ul><li>Send: write() system call </li></ul></ul></ul><ul><ul><ul><li>Receive: read() system call </li></ul></ul></ul><ul><li>Can be used for any packet capturing and analyzing protocol </li></ul>
  13. 13. Web : http://www.jwritings.com Email: [email_address]

×