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
N.Y.Pekin TomJim Post network To Jim Post code Destination address stamp Post system
TCP/IP First used protocol suite Universal De-facto standard Internet standard communication Host A Internet TCP/IP Host B
Data layer Transport Data link Network Physical OSI Model Upper layer session Presentation Application Layer7 Layer6 Layer5 Layer4 Layer3 Layer2 Layer1
Telnet FTP ASCII EBCDIC JPEG Keep different applications independent Authentication Example Session Upper Layer function Network User Interface Application Presentation Present data Encryption, decryption
TCP UDP SPX / HDLC EIA/TIA-232 V.35 IP IPX Example Data layer function Transport Network Data Link Physical Reliable and Unreliable transfer Use retransmission to ensure reliability Combine bit to byte and byte to frame Access media by MAC address Error detection without error correction Provide logical address and path-finding method for the working of routers Transfer bit between devices Define voltage, bit rate, physical connection
Upper Layer Data TCP Header IP Header MAC+LLC Header Segment Packet Bits Frame PDU FCS Data Encapsulation Transport Data Link Physical Network Presentation Application Session Upper Layer Data
MAC+LLC Header IP + TCP + Upper Layer Data TCP+ Upper Layer Data IP Header Upper Layer Data TCP Header Transport Data Link Physical Network Presentation Application Session Data Decapsulation
Course Outline OSI model and layer function TCP/IP protocol suite Transfer Control Protocol Internet Protocol Address Resolution Protocol
Application Presentation Session Transport Network Data Link Physical Application Transport Internet Data Link TCP/IP model vs OSI model
Application Data Link TCP FTPFTP TELNETTELNET DNSDNS TFTPTFTP SMTPSMTP UDP IP 176 SNMPSNMP Application Transport Internet Data Link ARPICMP Ethernet II (RFC 894 ) TCP/IP Protocol Suite
Course Outline OSI Model and Layer Function TCP/IP Protocol Suite Transfer Control Protocol Internet Protocol Address Resolution Protocol
Transport Layer Segment upper layer data Establish end to end connection Ensure the reliability of data transfer Logical connection
TCP Protocol Source port (16) Destination port (16) Sequence number (32) Header length (4) Acknowledgement number (32) Reserved (6) Code bits (6) Window (16) Checksum (16)Urgent (16) Options (0 or 32 if any) Data (varies) 20 Bytes Bit 0 Bit 15Bit 16Bit 31
well-known port number : common port number: Port Number range Application TCP FTPFTP TELNETTELNET DNSDNS TFTPTFTP SMTPSMTP UDP SNMPSNMP Application Transport Application Transport Internet Data Link
Source Port Number Destination Port Number client SPDP Telnet Z Process #1 Port Number function Destination port = 23 Send packet to my Telnet application server Telnet Z Process #2 Port multiplexing
SenderReceiver Send 2 Send 1 Send 3 Ack 4 Send 5 Send 4 Send 6 Retransfer 5 Send 5 Ack Sequence and Ack Number
Code Bits 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 URGURG PSHPSH RSTRST SYNSYN FINFIN ACKACK
Window size = 1 Send 1 Receive 1 Ack 2 Send 2 Receive 2 Ack 3 Send 1 Send 2 Receive 1 Receive 2 Window size = 3 Send 3 Receive 3 Ack 4 Send 4 SenderReceiver SenderReceiver Window control
Establish connection (synchronize) Data transfer (Send Segments) SenderReceiver Connection-oriented session Tear down connection TCP connection
Send SYN (seq=100 ctl=SYN) SYN received Send SYN, ACK (seq=300 ack=101 ctl=SYN,ACK) Established (seq=101 ack=301 ctl=ACK) Host AHost B SYN received Establish Connection TCP Three Way Handshake/Open Connection Established
SourceDest Seq. 302 Ack SourceDest Seq. 301 Ack SourceDest Seq. 301 Ack SourceDest Seq. 302 Ack. Data transfer SPDPSeq. #Ack. # Host AHost B Upper layer data
ACK to FIN FIN Close application Host A Host B Close application Tear down connection TCP four way handshakes/connection terminating
UDP Protocol No sequence and acknowledgement Unreliable and connectionless Efficient and fast Source port (16) Destination port (16) Length (16) Data (if any) Bit 0Bit 15Bit 16Bit 31 Checksum (16) 8 Bytes
TCPUDP Connection oriented Or connectionless Connection oriented connectionless Reliable or not Reliableunreliable With traffic Control Or not Traffic controlNo traffic control Transfer speed SlowFast overhead of protocol BigSmall TCP/UDP Comparison
Course Outline OSI Model and Layer Function TCP/IP Protocol Suite Transfer Control Protocol Internet Protocol Address Resolution Protocol
Data Link TCP UDP IP 176 Application Transport Internet Data Link ARPICMP 1 Internet/Network layer Define logical address Provide path-finding method routers
IP packet format Version (4) Destination IP Address (32) Options (0 or 32 if any) Upper layer data (varies if any) 1 Bit 0 Bit 15Bit 16Bit 31 Header Length (4) Type of Service (8) Total Length (16) Identification (16) Flags (3) Fragment offset (13) Time to live (8) Protocol (8)Header checksum (16) Source IP Address (32) 20 Bytes
Type of Service field precedence DTR00 Bits 0-2: Precedence Bit 3: Delay Bit 4: Throughput Bit 5: Reliability Bits 6-7: Reserved for future use 037
MTU and fragmentation Identification (16)Fragment offset (13) Flags(3) DFDF 0 MFMF 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 A Host B Ethernet MTU 1000 IP(1500) HDLCIP(750) HDLCIP(750) EthernetIP(750) EthernetIP(750) RARB
IP Address Host A Host B Fei_1/1Fei_1/2 255 Dotted Decimal Maximum NetworkHost Binary
ICMP Data Link IP Application Transport Internet Data Link ICMP 1
Host A I am here. ICMP echo reply Hi B, are you there? Host B ICMP echo request PING and reachability Host or port unreachable Network unreachable Destination Unreachable Is B reachable? ICMP echo request no yes
Time Exceeded and TTL Host A Host B A: Tracert : : : RARB TTL=1 TTL=2 TTL=3
Course Outline OSI Model and Layer Function TCP/IP Protocol Suite Transfer Control Protocol Internet Protocol Address Resolution Protocol
Data link Layer 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 IP Application Transport Internet Data Link ARPICMP Ethernet II (RFC 894 )
Data Src. AddrFCS Type Dest. Addr Variable Length d0.d0 xx.xx.xx Sequence ID for NIC IEEE assign to Manufacturers Ethernet II frame (RFC 894) Preamble 8# Bytes 48-bits MAC Address
Address Resolution Protocol Map IP to MAC Local broadcast IP: Ethernet: IP: Ethernet: IP: = ??? I got the packet, I will reply with my MAC address. I need the MAC address of IP Host A Host B Other hosts
Packet process procedure FTP client ftp:// :21 I wanna download a file SP:1024 DP:21 Seq.100 Ack.200 FTP server SIP: DIP: ,TTL=100, DF, Protocol=7 SA: DA: A type=
Summarization OSI reference model TCP protocol suite Transport layer Network layer Data link layer