590 likes | 601 Views
Learn about TCP/IP layers, protocols, and network technologies like Ethernet and WAN. Explore OSI model, TCP/IP stack, data encapsulation, and network access techniques. Discover LAN and WAN technologies like Token Ring and Frame Relay.
E N D
Internet 概念 UNIX 主機 UNIX 主機 Internet TCP/IP • 使用TCP/IP通訊協定 • 全球性的網路
Application Layer Host-to-Host Transport Layer Internet Layer Network Access Layer 什麼是TCP/IP ? • Transmission Control Protocol/Internet Protocol • TCP/IP Model
什麼是TCP/IP ? (Cont.) Application Layer Data Transport Layer Header Data Internet Layer Header Header Data Network Access Layer Header Header Header Data Send Receive 資料打包
TCP stream segment datagram frame 什麼是TCP/IP ? (Cont.) Application Layer UDP message Transport Layer packet Internet Layer datagram Network Access Layer frame 資料結構
TCP/IP 協定 v.s.OSI 協定 TCP/IP Conceptual Layers OSI Reference Model 7 Application Presentation Application 6 Session 5 4 Transport Transport Internet 3 Network 2 Data Link Network Interface Ethernet, 802.3, 802.5,FDDI, etc. Physical 1
TCP/IP Protocol Stack Application UDP TCP ICMP Internet ARP,RARP Network Interface
TCP/IP Protocol Stack Host B Host A Application Identical message Application Identical paclet Transport Transport Gateway G Internet Internet Identical datagram Internet Identical datagram Network Interface Network Interface Network Interface Identical frame Identical frame Physical Net 1 Physical Net 2
TCP/IP Protocol Stack Conceptual Layer Objects Passed Between Layers Application Messages or Streams Transport Transport Protocol Packets Internet IP Datagrams Network Interface Network-Specific Frames Hardware
Application Layer 簡介 File Transfer -TFTP* -FTP -NFS E-Mail -SMTP Remote Login -Telnet* -rlogin Network Management -SNMP* Application Transport Internet Network Interface * Used by the router
Transport Layer 簡介 Application Transmission Control Protocol (TCP) User Datagram Protocol(UDP) Transport Internet Network Interface
Application Internet Protocol ( IP) Address Resolution Protocol ( ARP ) Reverse Address Resolution Protocol ( RARP ) Internet Control Message Protocol ( ICMP ) Transport Internet Network Interface Internet Layer 簡介
Network Interface Layer 簡介 Application Transport Ethernet/IEEE802.3 Token Ring/IEEE802.5 FDDI Internet Network Interface
Physical and Data Link Standards X.25 Link Frame Relay 802.2 LLC Dial on Demand SDLC HDLC ISDN PPP Data Link ( frames ) E t h e r n e t 8 0 2 . 3 8 0 2 . 5 F D D I physical ( bits, signals, clocking) V.24 EIA/TIA-232 G.703 V.35 EIA/TIA-449 EIA-530 HSSI • Separate physical and data link layers for LAN and WAN
LAN Data Link Sublayers Logical Link Control Network LLC Data Link MAC Physical Media Access Control MAC Frame Packet or Datagram 802.2 LLC • LLC refers upward to higher-layersoftware functions • MAC refers downward to lower-layerhardware functions
Media Access Control (MAC) 24 bits 24 bits Serial Number Vendor Code 0000.0c 12. 3456 ROM RAM • MAC address is burned into ROM on • a network interface card
區域網路的技術 • Ethernet / IEEE802.3 • Token Ring / IEEE802.5 • FDDI
Ethernet / IEEE 802.3 • 網路拓撲 : Bus topology • 存取方法 : CSMA / CD
Physical Layer : Ethernet/802.3 Host 10Base2 - Thin Ethernet 10Base5 - Thick Ethernet Hub 10BaseT - Twisted Pair PC Sun Sun Mac
A B C D Application Presentation Session Transport Network Data Link Physical Ethernet /802.3 Operation D B and C Application Presentation Session Transport Network Data Link Physical
A B C D Application Application Application Application Presentation Presentation Presentation Presentation Session Session Session Session Transport Transport Transport Transport Network Network Network Network Data Link Data Link Data Link Data Link Physical Physical Physical Physical Ethernet / 802.3 Broadcast
Common WAN Technologies SDLC HDLC LAPB PPP X.25 Frame Relay ISDN
Physical Layer : WAN RS-232 V.35 X.21 HSSI others DSU/CSU (Modem) DTE Data Terminal Equipment End of the users device on the WAN link DCE Data Circuit-terminating Equipment End of the WAN providers side of the communication facility
Data Link Layer : WAN Protocols (Modem) (Modem) DSU/CSU DSU/CSU • SDLC-Synchronous Data Link Control For IBM SNA networks;primary and secondary roles on link • HDLC-High-level Data Link Control Default for Cisco Router-common WAN data link • LAPB-Link Access Protocol,Balanced DTE-to-DCE data link for x.25;either side initiates a link • Frame Relay-Simplified version of HDLC framing for higher speed,unacknowledged data communications • PPP-Point-to-Point Protocol Part of TCP/IP stack for WAN links;can support ISDN
Token Ring LAN-to-LAN Routing From LAN to LAN Network2 Host 5 Host 4 Network3 T0 E1 Network 1 E0 802.5 Net 2,Host 5 802.3 Net 2,Host 5 Routing Table Destination Network Outgoing Interface 1 2 3 E0 T0 E1
Frame Relay Data Data Data Data Data Data Data 1.3 1.3 1.3 1.3 1.3 1.3 1.3 2.4 2.4 2.4 2.4 2.4 2.4 2.4 Token Ring LAN-to-WAN Routing Data From LAN Token Ring 1.3 to WAN Frame Relay A Ethernet to LAN B Data 2.4
Layer Decapsulation telnet Ftp Smtp tftp • Port Number • Protocol Number • TYPE,SAP,or Control Info • MAC or WAN addressing UPPER LAYERS TRANSPORT NETWORK DATA LINK PHYSICAL 21 25 69 23 TCP UDP 6 17 IP Packets Frames Bits • A TCP/IP Example
TCP/IP Address Overview Unix Host Unix Host • Unique addressing allows communication between end stations • Path choice is based upon location • Location is represented by an address Company A Company A
IP Addressing 32 Bits Network Host 8Bits 8Bits 8Bits 8Bits 131 . 108 . 122 . 204
IP Addresses • Class A: • Class B: • Class C: N H H H N N H H N N N H N = Network number assigned by NIC H = Host number assigned by network administrator
IP Addresses (cont.) # Bits 1 7 24 Class A: Class B: Class C: 0 network # host # 1 1 14 16 1 0 network # host # 1 1 1 21 8 1 1 0 network # host #
Recognizing Classes in IPAddresses (First Octet Rule) High Order Octet in Address Bits Decimal Class 0 1 - 126 A 10 128 - 191 B 110 192 - 223 C
Broadcast Addresses 131.108.3.0 131.108.4.0 131.108.1.0 131.108.2.0 131.108.3.255 (Directed broadcast) 255.255.255.255 (Local network broadcast)
0 4 8 16 19 24 31 IP Datagram
IP Datagram (Cont.) HLEN: IP packet header長度 Total length: IP packet 總長度(包含表頭和資料區) Identification:IP packet編號 Time to Live:IP packet在網路上存留時間(以秒為單位) Protocol:上層的協定 17 ==> UDP 6 ==> TCP 1 ==> ICMP Padding:補足未滿32位元的IP header
Protocol Field Transport Layer TCP UDP Protocol Numbers 6 17 Internet Layer IP • Determines destination upper-layer protocol
Address Resolution Protocol (ARP) I heard that broadcast, that’s me. Here is my Ethernet Address. I need the Ethernet address of 131.108.3.2 131.108.3.1 131.108.3.2 IP : 131.108.3.2 = ??? IP: 131.108.3.2 = Ethernet: 0800.0020.1111 • Map IP Ethernet • Local ARP
ARP Request ARP Request Host Y Host Y Host Z MAC ? Host Z MAC ? Host Z Host Z Broadcast Broadcast ARP Request ARP Request Host Y MAC Host Y MAC Router MAC ? Host Z MAC ? Address Resolution Protocol (ARP) Host z Example 1 : TCP/ IP destination local Router A Example 2 : TCP/ IP destination local not local • ARP finds the MAC address to use for • a data link connection
Reverse ARP (RARP) I heard that broadcast. IP address is 131.108.3.25 What is my IP address? Ethernet = 0800.0020.1111IP = ??? Ethernet=0800.0020.1111 IP = 131.108.3.25 • Map Ethernet IP • ARP and RARP are implemented directly on top of the data link layer
SENDER RECEIVER Synchronize Negotiate Connection Synchronize Acknowledge Connection Established Data Transfer (Send Segments) Transport: 連線建立
RECEIVER SENDER Send Segments with Flow Control Transmit Buffer full Process Segments Buffer OK Not Ready Stop Ready Go Resume Transmission
TCP Three-Way Handshake/Open Connection Host A Host B Send SYN (seq = x ) Receive SYN(seq = x) Send SYN (seq=y, ack=x+1) Receove ACK (ack=y+1) Receive SYN( seq=y , ack=x+1 ) Send ACK (ack = y+1)
TCP Segment 格式 #Bits 16 16 32 32 4 6 6 Source Port Dest Sequence Acknowledgment HLEN Reserved Code Port # # Bits 16 16 16 32 Window Check- Urgent Option Data….. sum Pointer
TCP Port Numbers Source Dest …. Port Port Host A Host Z Dest. port=23 Send packet to my Telnet application Telnet Z SP DP 1028 23 ……...
TCP Sequence and Acknowledgment Numbers Source Dest. Sequence Acknowledgment Port Port # # ... I just sent # 10. I just got #10, now I need #11. Source Dest. Seq. Ack. 1028 23 10 1 ... Source Dest. Seq. Ack. 23 1028 1 11 ... Source Dest. Seq. Ack. 1028 23 11 2 ...
Port Numbers F T P T S D T S E M N F N L T S T M N P P P E T Application Layer Port Numbers 21 23 25 53 69 161 Transport Layer TCP UDP