Presentation is loading. Please wait.

Presentation is loading. Please wait.

TCP/IP Concepts. Internet 概念 m 使用 TCP/IP 通訊協定 m 全球性的網路 Internet TCP/IP UNIX 主機.

Similar presentations


Presentation on theme: "TCP/IP Concepts. Internet 概念 m 使用 TCP/IP 通訊協定 m 全球性的網路 Internet TCP/IP UNIX 主機."— Presentation transcript:

1 TCP/IP Concepts

2 Internet 概念 m 使用 TCP/IP 通訊協定 m 全球性的網路 Internet TCP/IP UNIX 主機

3 什麼是 TCP/IP ? Transmission Control Protocol/Internet Protocol TCP/IP Model Application Layer Host-to-Host Transport Layer Internet Layer Network Access Layer

4 Application Layer Data Header Data Transport Layer DataHeader Internet Layer DataHeader Send Receive Network Access Layer 什麼是 TCP/IP ? (Cont.) 資料打包

5 Application Layer Transport Layer Internet Layer Network Access Layer message UDP stream segment datagram frame TCP packet datagram frame 資料結構 什麼是 TCP/IP ? (Cont.)

6 TCP/IP 協定 v.s.OSI 協定 OSI Reference Model TCP/IP Conceptual Layers 7 6 5 4 3 2 1 Application Presentation Session Transport Network Data Link Physical Application Transport Internet Network Interface Ethernet, 802.3, 802.5,FDDI, etc.

7 TCP/IP Protocol Stack Application UDPTCP Network Interface Internet ARP,RARP ICMP

8 TCP/IP Protocol Stack Application Transport Internet Network Interface Host A Host B Identical message Identical paclet Identical datagram Identical frame Physical Net 1Physical Net 2 Gateway G

9 TCP/IP Protocol Stack Application Transport Internet Network Interface Conceptual Layer Hardware Objects Passed Between Layers Messages or Streams Transport Protocol Packets IP Datagrams Network-Specific Frames

10 Application Layer 簡介 Application Transport Internet Network Interface File Transfer -TFTP* -FTP -NFS E-Mail -SMTP Remote Login -Telnet* -rlogin Network Management -SNMP* * Used by the router

11 Transport Layer 簡介 Application Transport Internet Network Interface Transmission Control Protocol (TCP) User Datagram Protocol(UDP )

12 Internet Layer 簡介 Application Transport Internet Network Interface Internet Protocol ( IP) Address Resolution Protocol ( ARP ) Reverse Address Resolution Protocol ( RARP ) Internet Control Message Protocol ( ICMP )

13 Network Interface Layer 簡介 Application Transport Internet Network Interface Ethernet/IEEE802.3 Token Ring/IEEE802.5 FDDI

14 網路存取層介紹

15 Physical and Data Link Standards Separate physical and data link layers for LAN and WAN Data Link ( frames ) physical ( bits, signals, clocking) 802.2 LLC EthernetEthernet 802.3802.3 802.5802.5 FDDIFDDI Dial on Demand SDLC HDLC X.25 Link Frame Relay ISDN PPP V.24 EIA/TIA-232 G.703 V.35 EIA/TIA-449 EIA-530 HSSI

16 LAN Data Link Sublayers Network LLC Data Link Physical MAC Logical Link Control Media Access Control MAC Frame 802.2 LLC Packet or Datagram LLC refers upward to higher-layer software functions MAC refers downward to lower-layer hardware functions

17 Media Access Control (MAC) Vendor Code Serial Number 24 bits ROM RAM 0000.0c 12. 3456 MAC address is burned into ROM on a network interface card

18 區域網路的技術 Ethernet / IEEE802.3 Token Ring / IEEE802.5 FDDI

19 Ethernet / IEEE 802.3 網路拓撲 : Bus topology 存取方法 : CSMA / CD

20 Physical Layer : Ethernet/802.3 Hub PC Sun Mac Host 10BaseT - Twisted Pair 10Base2 - Thin Ethernet 10Base5 - Thick Ethernet

21 Ethernet /802.3 Operation Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical A A B B C C D D D D B and C

22 Ethernet / 802.3 Broadcast Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical Application Presentation Session Transport Network Data Link Physical ABCD

23 Common WAN Technologies SDLC HDLC LAPB PPP X.25 Frame Relay ISDN

24 Physical Layer : WAN DSU/CSU RS-232 V.35 X.21 HSSI others (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

25 Data Link Layer : WAN Protocols 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 (Modem) DSU/CSU

26 LAN-to-LAN Routing E1 Routing Table E0 Host 4 802.3Net 2,Host 5 Destination Network Outgoing Interface 123123 E0 T0 E1 802.5Net 2,Host 5 Token Ring Host 5 to LANFrom LAN Network 1 T0 Network3 Network2

27 LAN-to-WAN Routing Token Ring Frame Relay 1.3 2.4 From LAN to WAN to LAN Data 1.32.4 Data 1.32.4 Data Token Ring 1.32.4 Data 1.32.4 Data Frame Relay 1.32.4 Data 1.32.4 Data Ethernet 1.32.4 Data A B

28 Layer Decapsulation telnettelnet FtpFtp SmtpSmtp tftptftp 23 212569 TCPUDP 617 IP Packets Frames Bits A TCP/IP Example UPPER LAYERS TRANSPORT NETWORK DATA LINK PHYSICAL Port Number Protocol Number TYPE,SAP,or Control Info MAC or WAN addressing

29 IP 協定介紹

30 TCP/IP Address Overview Unique addressing allows communication between end stations Path choice is based upon location Location is represented by an address Unix Host Company A

31 IP Addressing 32 Bits Network Host 131. 108. 122. 204 8Bits 8Bits 8Bits 8Bits

32 IP Addresses  Class A:  Class B:  Class C: N H H H N N N H N N H H N = Network number assigned by NIC H = Host number assigned by network administrator

33 IP Addresses (cont.) # Bits 1 7 24 0 network # host # 1 0 network # host # 1 1 0 network # host # Class A: Class B: Class C: 1 1 14 16 1 1 1 21 8

34 Recognizing Classes in IP Addresses (First Octet Rule) High Order Octet in Address Bits Decimal Class 0 1 - 126 A 10 128 - 191 B 110 192 - 223 C

35 Broadcast Addresses 131.108.3.255 (Directed broadcast) 255.255.255.255 (Local network broadcast) 131.108.3.0 131.108.4.0 131.108.2.0 131.108.1.0

36 0 4 8 16 19 24 31 IP Datagram

37 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 IP Datagram (Cont.)

38 Protocol Field TCP UDP 6 17 Transport Layer Internet Layer IP Protocol Numbers m Determines destination upper-layer protocol

39 ARP/RARP 協定介紹

40 m Map IP Ethernet m Local ARP 131.108.3.1131.108.3.2 I need the Ethernet address of 131.108.3.2 I heard that broadcast, that’s me. Here is my Ethernet Address. IP : 131.108.3.2 = ??? IP: 131.108.3.2 = Ethernet: 0800.0020.1111 Address Resolution Protocol (ARP)

41 Host Y Broadcast ARP Request Host Z MAC ? Host Z Host z Broadcast ARP Request Host Z MAC ? Host Z Host Y MAC ARP Request Host Z MAC ? Host Y MAC ARP Request Router MAC ? Router A Example 1 : TCP/ IP destination local Example 2 : TCP/ IP destination local not local ARP finds the MAC address to use for a data link connection

42 Reverse ARP (RARP) m Map Ethernet IP m ARP and RARP are implemented directly on top of the data link layer Ethernet = 0800.0020.1111IP = ??? Ethernet=0800.0020.1111 IP = 131.108.3.25 What is my IP address? I heard that broadcast. IP address is 131.108.3.25

43 TCP 協定介紹

44 Transport: 連線建立 RECEIVERSENDER Connection Established Synchronize Negotiate Connection Synchronize Acknowledge Data Transfer (Send Segments)

45 Send Segments with Flow Control RECEIVER SENDER Transmit Not Ready Ready Resume Transmission Stop Go Buffer full Process Segments Buffer OK

46 TCP Three-Way Handshake/Open Connection Host B Host A Receive SYN(seq = x) Send SYN (seq=y, ack=x+1) Receove ACK (ack=y+1) Send SYN (seq = x ) Receive SYN( seq=y, ack=x+1 ) Send ACK (ack = y+1)

47 TCP Segment 格式 16 32 32 4 6 6#Bits 16 Source Port Dest Sequence Acknowledgment HLEN Reserved Code Port # # Bits 16 16 16 32 Window Check- Urgent Option Data….. sum Pointer

48 TCP Port Numbers 1028 23 ……... SP DP Telnet Z Source Dest …. Port Port Host A Host Z Dest. port=23 Send packet to my Telnet application

49 TCP Sequence and Acknowledgment Numbers Source Dest. Sequence Acknowledgment Port Port # #... Source Dest. Seq. Ack. 1028 23 10 1... Source Dest. Seq. Ack. 1028 23 11 2... Source Dest. Seq. Ack. 23 1028 1 11... I just sent # 10. I just got #10, now I need #11.

50 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 21 23 25 53 69 161 TCP UDP Port Numbers Transport Layer

51 Currently assigned TCP port numbers

52 Bit (left to right) TCP Header Code field Meaning if bit set to 1 URG ACK PSH RST SYN FIN Urgent pointer field is valid Acknowledgement field is valid This segment requests a push Rest the connection Synchronize sequence numbers Sender has reaches end of its bye stream

53 TCP Simple Acknowledgment  Window size = 1 Send 1 Receive ACK 2 Send 2 Receive ACK 3 Send 3 Receive ACK 4 Receive 1 Send ACK 2 Receive 2 Send ACK 3 Receive 3 Send ACK 4 SenderReceiver

54 TCP Sliding Window Send 1 Send 2 Send 3 Receive ACK 4 Send 4 Send 5 Send 6 Receive ACK 7  Window size = 3 Receive 1 Receive 2 Receive 3 Send ACK 4 Receive 4 Receive 5 Receive 6 Send ACK 7 Sender Receiver

55 Transport: Windowing SENDER RECEIVER Receive 1 Ack2 Receive 2 Ack3 Send 1 Send 2 Send 1 Send 2 Send 3 Receive 1 Receive 2 Receive 3 Ack4 Send 4 . Window size = 1 . Window size = 3

56 UDP 協定介紹

57 UDP Segment 格式 Source Destination Length Check- Data… Port Port sum # Bits 16 16 16 16 mNo sequence or acknowledgement fields

58 A UDP datagram encapsulated in an IP datagram UDP HEADER UDP DATA AREA IP HEADER UDP DATA AREA FRAME HEADER FRAME DATA AREA

59 Currently assigned UDP ports


Download ppt "TCP/IP Concepts. Internet 概念 m 使用 TCP/IP 通訊協定 m 全球性的網路 Internet TCP/IP UNIX 主機."

Similar presentations


Ads by Google