1 / 42

TCP/IP Basic Theory

TCP/IP Basic Theory. V1.2. Course Outline. OSI model and layer function TCP/IP protocol suite Transfer Control Protocol Internet Protocol Address Resolution Protocol. Post system. Jim. Tom. N.Y. Pekin. Post network. To Jim. Post code. stamp. Destination address.

Download Presentation

TCP/IP Basic Theory

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 Basic Theory V1.2

  2. Course Outline • OSI model and layer function • TCP/IP protocol suite • Transfer Control Protocol • Internet Protocol • Address Resolution Protocol

  3. Post system Jim Tom N.Y. Pekin Post network To Jim Post code stamp Destination address

  4. First used protocol suite Universal De-facto standard Internet standard communication TCP/IP Host A Host B Internet TCP/IP

  5. OSI Model Application Layer7 Upper layer Presentation Layer6 Layer5 session Layer4 Transport Layer3 Network Data layer Layer2 Data link Layer1 Physical

  6. Upper Layer function Example Application Telnet FTP Network User Interface ASCII EBCDIC JPEG • Present data • Encryption, decryption Presentation Keep different applications independent Session Authentication

  7. Data layer function Example TCP UDP SPX • Reliable and Unreliable transfer • Use retransmission to ensure reliability Transport Provide logical address and path-finding method for the working of routers IP IPX Network • Combine bit to byte and byte to frame • Access media by MAC address • Error detection without error correction 802.3 / 802.2 HDLC Data Link • Transfer bit between devices • Define voltage, bit rate, physical connection EIA/TIA-232V.35 Physical

  8. FCS Data Encapsulation Application Presentation PDU Upper Layer Data Session Transport Segment TCP Header Upper Layer Data Network Packet Upper Layer Data IP Header Upper Layer Data Frame MAC+LLC Header Data Link Physical 0101110101001000010 Bits

  9. Data Decapsulation Application Presentation Upper Layer Data Session Transport Upper Layer Data TCP Header Network TCP+ Upper Layer Data IP Header IP + TCP + Upper Layer Data Data Link MAC+LLC Header 0101110101001000010 Physical

  10. Course Outline • OSI model and layer function • TCP/IP protocol suite • Transfer Control Protocol • Internet Protocol • Address Resolution Protocol

  11. TCP/IP model vs OSI model Application Presentation Application Session Transport Transport Internet Network Data Link Data Link Physical

  12. TCP/IP Protocol Suite SNMP FTP TELNET SMTP DNS TFTP Application 21 23 25 53 69 161 Application TCP UDP Transport 6 17 ARP IP ICMP Internet 1 Data Link 0806 0800 Data Link Ethernet II (RFC 894 )

  13. Course Outline • OSI Model and Layer Function • TCP/IP Protocol Suite • Transfer Control Protocol • Internet Protocol • Address Resolution Protocol

  14. Transport Layer • Segment upper layer data • Establish end to end connection • Ensure the reliability of data transfer Logical connection

  15. TCP Protocol Bit 0 Bit 15 Bit 16 Bit 31 Destination port (16) Source port (16) Sequence number (32) Acknowledgement number (32) 20Bytes Headerlength (4) Reserved (6) Code bits (6) Window (16) Checksum (16) Urgent (16) Options (0 or 32 if any) Data (varies)

  16. Port Number range SNMP FTP TELNET SMTP DNS TFTP Application 21 23 25 53 69 161 Application Application TCP Transport UDP Transport Internet well-known port number :1-1023 common port number: 1024-65535 Data Link

  17. Port Number function Source Port Number Destination Port Number Destination port = 23Send packet to my Telnet application Telnet Z Process #1 client server Telnet Z Process #2 Port multiplexing SP DP 1028 23 1029 23

  18. Sequence and Ack Number Sender Receiver 1 2 3 4 5 6 1 2 3 4 5 6 Send 1 Send 2 Send 3 Ack 4 Send 4 Send 5 Send 6 Retransfer 5 Send 5 Ack 7

  19. URG: Urgent Pointer field significant ACK: Acknowledgment field significant PSH: Push function RST: Reset the connection SYN: Synchronize sequence numbers FIN: No more data from sender Code Bits P S H R S T S Y N F I N U R G A C K

  20. Window control Window size = 1 Send 1 Receive 1 Ack 2 Send 2 Receive 2 Sender Receiver Ack 3 Window size = 3 Send 1 Receive 1 Receive 2 Send 2 Receive 3 Send 3 Ack 4 Sender Receiver Send 4

  21. 1 2 3 Connection-oriented session TCP connection Sender Receiver Establish connection (synchronize) Data transfer (Send Segments) Tear down connection

  22. 1 2 3 Establish Connection TCP Three Way Handshake/Open Connection Host A Host B Send SYN (seq=100 ctl=SYN) SYN received Send SYN, ACK (seq=300 ack=101 ctl=SYN,ACK) SYN received Established (seq=101 ack=301 ctl=ACK) Established

  23. SP DP Seq. # Ack. # Data transfer Upper layer data Host A Host B Source Dest. Seq. Ack. 1028 23 102 301 Source Dest. Seq. Ack. 23 1028 301 103 Source Dest. Seq. Ack. 1028 23 103 302 Source Dest. Seq. Ack. 23 1028 302 104

  24. 1 2 3 4 Tear down connection • TCP four way handshakes/connection terminating Host A Host B Close application FIN ACK to FIN FIN Close application ACK to FIN

  25. UDP Protocol • No sequence and acknowledgement • Unreliable and connectionless • Efficient and fast Bit 0 Bit 15 Bit 16 Bit 31 Destination port (16) Source port (16) 8Bytes Length (16) Checksum (16) Data (if any)

  26. TCP/UDP Comparison TCP UDP Connection oriented Connection oriented Or connectionless connectionless Reliable unreliable Reliable or not With traffic Control Or not Traffic control No traffic control Slow Fast Transfer speed overhead of protocol Big Small

  27. Course Outline • OSI Model and Layer Function • TCP/IP Protocol Suite • Transfer Control Protocol • Internet Protocol • Address Resolution Protocol

  28. Internet/Network layer • Define logical address • Provide path-finding method routers Application TCP UDP Transport 6 17 ARP IP ICMP 1 Internet Data Link Data Link

  29. IP packet format Bit 0 1 Bit 15 Bit 16 Bit 31 Version(4) HeaderLength (4) Type of Service (8) Total Length (16) Flags(3) Identification (16) Fragment offset (13) 20Bytes Time to live (8) Protocol (8) Header checksum (16) Source IP Address (32) Destination IP Address (32) Options (0 or 32 if any) Upper layer data (varies if any)

  30. Type of Service field 0 3 7 precedence D T R 0 0 Bits 0-2: Precedence Bit 3: Delay Bit 4: Throughput Bit 5: ReliabilityBits 6-7: Reserved for future use

  31. MTU and fragmentation 0 15 16 17 18 D F M F Identification (16) Fragment offset (13) 0 Flags(3) Bit 16: Reserved, must be zero Bit 17: (DF)0=May fragment, 1=Don’t fragment Bit 18: (MF)0=Last fragment, 1=More fragment Host B Host A MTU 1000 RA RB Ethernet IP(1500) HDLC IP(750) Ethernet IP(750) HDLC IP(750) Ethernet IP(750)

  32. IP Address Host B Host A Fei_1/1 Fei_1/2 10.250.8.11 172.16.2.1 172.16.2.1 10.6.24.2 0 7 8 15 23 24 31 16 DottedDecimal Network Host 255 255 255 255 Maximum 11111111 11111111 11111111 11111111 Binary 1286432168421 1286432168421 1286432168421 1286432168421

  33. ICMP Application Transport IP ICMP 1 Internet Data Link Data Link

  34. PING and reachability • Host or port unreachable • Network unreachable Hi B, are you there? Host A I am here. HostB ICMP echo reply Is B reachable? ICMP echo request yes no Destination Unreachable ICMP echo request

  35. Time Exceeded and TTL A: Tracert 10.1.1.2 1: 172.16.1.1 2: 200.1.1.2 3: 10.1.1.2 Host B Host A 10.1.1.1 172.16.1.1 200.1.1.2 RA 200.1.1.1 RB 172.16.1.2 10.1.1.2 TTL=1 TTL=2 TTL=3

  36. Course Outline • OSI Model and Layer Function • TCP/IP Protocol Suite • Transfer Control Protocol • Internet Protocol • Address Resolution Protocol

  37. Combine bit to byte and byte to frame Access media by physical address (MAC address) SAP associated with upper layer protocols type Error detection without error correction Data link Layer Application Transport ARP IP ICMP Internet 1 Data Link 0806 0800 Data Link Ethernet II (RFC 894 )

  38. 48-bits MAC Address Ethernet II frame (RFC 894) Variable Length 46-1500 # Bytes 8 6 6 2 4 Type Dest. Addr Src. Addr FCS Preamble Data • 00.d0.d0 xx.xx.xx IEEE assign to Manufacturers Sequence ID for NIC

  39. Address Resolution Protocol • Map IP to MAC • Local broadcast I need the MAC address of IP 172.16.3.2 I got the packet, I will reply with my MAC address. Host B Host A 172.16.3.1 172.16.3.2 Other hosts IP: 172.16.3.2 = ??? IP: 172.16.3.2 Ethernet: 0800.0020.1111

  40. Packet process procedure FTP client FTP server ftp://10.66.1.100:21 I wanna download a file SP:1024 DP:21 Seq.100 Ack.200 SIP:10.66.1.1 DIP:10.66.1.100,TTL=100, DF, Protocol=7 SA:01-00-39 DA:01-00-4A type=0800 01010010100010101010101010100010110111000101001

  41. Summarization • OSI reference model • TCP protocol suite • Transport layer • Network layer • Data link layer

More Related