1 / 95

TCP/IP Protocol Stack

TCP/IP Protocol Stack. Overview. To communicate, two machines have to use the same protocol TCP/IP has become the defacto protocol for the transport and network layers of the network stack Application layer is informally represented by system libraries. Overview.

Mia_John
Download Presentation

TCP/IP Protocol Stack

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. TCP/IP Protocol Stack

  2. Overview • To communicate, two machines have to use the same protocol • TCP/IP has become the defacto protocol for the transport and network layers of the network stack • Application layer is informally represented by system libraries

  3. Overview • TCP/IP is based on the Client/Server model • One machine/host is called the Server and provides services. The Server LISTENS for requests • The other side of the connection is a client, that initiates the connection by requesting services from a server

  4. Overview • Peer to Peer relationships, (Microsoft file sharing, Bit Torrent) are represented by having both machines act as both clients and servers • There is no special support for Peer to Peer communication in TCP/IP

  5. Transport Layer

  6. TCP/IP Transport Layer • There are two major protocols used for delivering data at the transport layer: • TCP, and • UDP.

  7. TCP/IP Transport Layer • UDP is a simple protocol that does not promise delivery of packets.

  8. TCP/IP Transport Layer • TCP is a more complicated protocol that does promise packet delivery.

  9. Service Ports

  10. TCP/IP Service Ports • Both TCP and UDP use numeric port numbers to do their work. • These port number represent virtual or imaginary ports. • In many ways, these resemble the physical ports you plug devices into on your computer.

  11. Service Ports • Physical ports include • Parallel port for older printers • Comm ports for external modems • USB port is actually a kind of simple network connection

  12. TCP/IP Service Ports • The reason for ports is that computers can communicate for a number of different reasons. • For example, web pages, email, streaming video. • The ports identify • the program (service) that a client is requesting from a server • The program on the client that the server is replying to.

  13. TCP/IP Service Ports • These port numbers can be used to indicate the program (client or server) • sending a packet, or • Receiving a packet. • This makes sure that information (the packets) get sent to the correct program running on the computer.

  14. TCP/IP Service Ports • For instance servers for • http (web pages) typically use port 80.

  15. TCP/IP Service Ports • For instance servers for • POP3 (downloading email) typically use port 110

  16. TCP/IP Service Ports • For instance servers for • SMTP (sending email) typically use port 25.

  17. TCP/IP Service Ports • It is however possible to set up services to use non-standard port numbers.

  18. TCP/IP Service Ports • It is however possible to set up services to use non-standard port numbers. • You could set up a http/web server that uses port 1234 if you wanted. 8080 is commonly used for private web servers. • Typically, standard ports are used, called Well Known Ports, because it makes services easier for clients to find.

  19. Service Ports – Client Side • Typically Client machines are assigned random ports by the operating system when they request a connection to a server. • These ports are assigned outside the usual range of numbers for server ports.

  20. UDP

  21. TCP/IP UDP • The UDP Protocol is conceptually very simple. • Packets are sent to their destination. • No effort is made to ensure their delivery. • Overhead is very low, so there is very little delay . . . If the Packet makes it. • In practice, modern networks are very reliable

  22. TCP/IP UDP • UDP is typically used for situations when the loss of an occasional packet is acceptable. • For example, streaming audio or video might use UDP. • UDP is used in “real time” applications, were delay is not easily tolerated • Communication with monitoring sensors.

  23. TCP

  24. TCP/IP TCP • The TCP protocol is used when it is important that each packet be delivered. • For example, when sending • Compressed video or image file. • A computer program. • Situations where the loss or mix-up of a packet would corrupt the information being sent.

  25. TCP/IP TCP • TCP has multiple ways to ensure packets are delivered. • An important way is acknowledgement (ACK). • When a message is received at its destination, an acknowledgement message is sent back to the source. • The ACK tells not just that a message was received, but exactly which message was received.

  26. TCP/IP TCP • Because of the overhead for ensuring delivery, TCP is slower than UDP. • Nothing comes for free. • Delays on individual packets, can reach several seconds before the connection is abandoned. Up to 60 second delays are tolerated

  27. TCP/IP TCP • Overhead is extra computer operations that the computer must do, such as sending and receiving acknowledgement messages. • Since each computer instruction takes time, overhead slows down the task the computer is performing.

  28. ICMP

  29. TCP/IP ICMP • In addition to TCP and UDP, there is an additional protocol, ICMP.

  30. TCP/IP ICMP • ICMP (Internet Control Message Protocol) is used for • diagnosing, and • reporting network errors.

  31. TCP/IP ICMP • ICMP is also a great protocol to use (abuse!) as the basis for network attacks. • We will discuss precisely how . . . Later.

  32. TCP-based Communications TCP • TCP is the work-horse transport level protocol on the Internet. • Much of the information that gets sent across the Internet uses TCP. • Most applications cannot tolerate • Lost packets, or • Packets that arrive out of order.

  33. TCP-based Communications TCP • TCP • ensures delivery, • in the proper order of packets sent between two computers.

  34. TCP-based Communications TCP • To do this, it uses several mechanisms:

  35. TCP-based Communications TCP • To do this, it uses several mechanisms: • Exclusive TCP Connection - hosts establish a session that allows them to track the traffic between them.

  36. TCP-based Communications TCP • To do this, it uses several mechanisms: • TCP Sequence Numbers - packets sent using TCP have packet sequence numbers.

  37. TCP-based Communications TCP • To do this, it uses several mechanisms: • Acknowledgements - Using sequence numbers, the recipient acknowledges packets received.

  38. TCP-based Communications TCP Connection • The host requesting a TCP connection is known as the client, and the other is the server. • Because the client is requesting a service from the server.

  39. TCP-based Communications TCP Connection • A potential sender and receiver establish a TCP connection by a procedure known as a handshake.

  40. TCP-based Communications TCP Connection • The handshake procedure:

  41. TCP-based Communications TCP Connection • The handshake procedure: • The client sends a SYN message(SYNc) to request a TCP connection with the server.

  42. TCP-based Communications TCP Connection • The handshake procedure: • The client sends a SYN message(SYNc) to request a TCP connection with the server. • A server returns a single packet that both • Acknowledges (ACKc) the client’s SYN, and • Sends its own connection request (SYNs).

  43. TCP-based Communications TCP Connection • The handshake procedure: • The client sends a SYN message(SYNc) to request a TCP connection with the server. • A server returns a single packet that both • Acknowledges (ACKc) the client’s SYN, and • Sends its own connection request (SYNs). • The client acknowledges (ACKs) the server’s message.

  44. TCP-based Communications TCP Connection • The handshake procedure: • The client sends a SYN message(SYNc) to request a TCP connection with the server. • A server returns a single packet that both • Acknowledges (ACKc) the client’s SYN, and • Sends its own connection request (SYNs). • The client acknowledges (ACKs) the server’s message. • After the handshake, the connection is established.

  45. TCP Handshake • The TCP handshake is often represented using a timeline.

  46. Client Server Time TCP-based Communications TCP Handshake

  47. Client Server Send SYNc TCP-based Communications TCP Handshake

  48. Client Server Send SYNc SYNc TCP-based Communications TCP Handshake

  49. Client Server Send SYNc Receive SYNc SYNc TCP-based Communications TCP Handshake

  50. Client Server Send SYNc Receive SYNc SYNc Send SYNs/ACKs TCP-based Communications TCP Handshake

More Related