Download presentation
Presentation is loading. Please wait.
Published byEunice Patrick Modified over 9 years ago
1
TCP/IP Lecture 2 cs193i – Internet Technologies Summer 2004 Stanford University
2
Announcements Lab #1 due Wednesday Lab #1 due Wednesday HW #1 assigned HW #1 assigned Extra perl session tomorrow Extra perl session tomorrow Tuesday, June 29, 2:15-3:05pm, Skilling 193 Tuesday, June 29, 2:15-3:05pm, Skilling 193 Broadcast live on E2, Stanford Online Broadcast live on E2, Stanford Online Silas’ Thursday office hours moved to Wednesday this week Silas’ Thursday office hours moved to Wednesday this week Sweet Hall, 6:30-8:30pm Sweet Hall, 6:30-8:30pm
3
Communicating with Anyone
4
Local Area Network (LAN) High speed, data network over small region High speed, data network over small region Few thousand meters Few thousand meters Network technologies: Network technologies: Ethernet Ethernet FDDI FDDI Token ring Token ring Data link layer Data link layer Packets routed based on physical address (MAC) Packets routed based on physical address (MAC) LAN 1 LAN 2
5
Local Area Network (LAN) High speed, data network over small region High speed, data network over small region Few thousand meters Few thousand meters Network technologies: Network technologies: Ethernet Ethernet FDDI FDDI Token ring Token ring Data link layer Data link layer Packets routed based on physical address (MAC) Packets routed based on physical address (MAC) LAN 1 LAN 2 ?
6
Connecting Below Internet Level Hub Hub Center of star topology Center of star topology In Ethernet, multiport repeater or concentrator In Ethernet, multiport repeater or concentrator Bridge Bridge Connects 2 networks of same technology – extended LAN Connects 2 networks of same technology – extended LAN Filters/forwards/floods based on MAC Filters/forwards/floods based on MAC Link layer - frames Link layer - frames Switch Switch Connects 2+ networks – packet-switched network Connects 2+ networks – packet-switched network Reduces collisions Reduces collisions Hub Bridge Switch
7
Connecting at the Internet Level Router Router Originally gateway Originally gateway Forwards packets based on network layer info (IP) Forwards packets based on network layer info (IP) Separate broadcast domains Separate broadcast domains In each domain, IP packet encapsulated in domain- specific packet In each domain, IP packet encapsulated in domain- specific packet Router
8
Internet Society Governing body for Internet since 1992 Governing body for Internet since 1992 http://www.isoc.org http://www.isoc.org Domain names and addresses assigned Domain names and addresses assigned Upper level: Internet Assigned Numbers Authority Upper level: Internet Assigned Numbers Authority Regional: Regional: Latin America / Caribbean Latin America / Caribbean Asia Pacific Asia Pacific America America Europe Europe
9
How Does Everyone Work Together? Networks Networks MCI Worldcom, Sprint, Earthlink, … MCI Worldcom, Sprint, Earthlink, … Exchange points provide connections between networks Exchange points provide connections between networks Network Access Points – open access policies Network Access Points – open access policies Network Service Provider Network Service Provider Build national or global networks Build national or global networks Lease space at NAPs Lease space at NAPs Sell bandwidth to regional NSPs Sell bandwidth to regional NSPs Regional NSP sell bandwidth to ISP Regional NSP sell bandwidth to ISP Internet Service Provider sells bandwidth to end users Internet Service Provider sells bandwidth to end users
10
How Does Everyone Work Together?
11
OSI Reference Model for Network Design Application (Layer 7) Presentation Session Transport Network Data Link Physical (Layer 1)
12
OSI vs. TCP/IP Stack Layering: FTP Example Network Link Transport Application Presentation Session Transport Network Link Physical The 7-layer OSI Model The 4-layer Internet model Application FTP ASCII/Binary IP TCP Ethernet
13
Internet Protocol
14
IP Datagram Header 10101011101010101010010101010100101010100 11010010101010010101111111010000011101111 10100001011101010100110101011110100000101 00100000000010101000011010000111111010101......... 1011011001010100011001001010110 Data
15
IP Addresses 4 8-bit numbers (Hierarchical) 4 8-bit numbers (Hierarchical) Specifies both network and host Specifies both network and host Number of bits allocated to specify network varies Number of bits allocated to specify network varies Three classes: Three classes: 0 net host 1 7 24 bits 110 net host 3 21 8 bits 1 0 net host 2 14 16 bits ABC 18.26.0.1 network 32-bits host
16
IP Addresses IP (Version 4) Addresses are 32 bits long IP (Version 4) Addresses are 32 bits long IP Addresses Assigned Statically or Dynamically (DHCP) IP Addresses Assigned Statically or Dynamically (DHCP) IPv6 addresses are 128 bits long IPv6 addresses are 128 bits long
17
IP Address Space Originally, 3 Classes Originally, 3 Classes A, B, C A, B, C Problem Problem Classes too rigid (C too small, B too big) Classes too rigid (C too small, B too big) Solution Solution Subnetting (e.g. within Stanford) Subnetting (e.g. within Stanford) Classless Interdomain Routing (CIDR) Classless Interdomain Routing (CIDR)
18
Subnetting IP Address plus subnet mask (netmask) IP Address plus subnet mask (netmask) IP Addr: 171.64.15.82 Netmask: 0xFFFFFF00 (111...1100000000) IP Addr: 171.64.15.82 Netmask: 0xFFFFFF00 (111...1100000000) First 24 bits are the Subnet ID (the neighborhood) First 24 bits are the Subnet ID (the neighborhood) Last 8 bits are Host ID (the street address) Last 8 bits are Host ID (the street address) Can be written as “Prefix + Length” Can be written as “Prefix + Length” 171.64.15.0/24 or 171.64.15/24 171.64.15.0/24 or 171.64.15/24
19
Subnetting at Stanford
20
IP Routing Routers are not omniscient Routers are not omniscient Next-Hop Next-Hop Hop-by-Hop Hop-by-Hop Thus IP makes no guarantees Thus IP makes no guarantees except to try it’s best (”Best Effort”) except to try it’s best (”Best Effort”) packets may get there out of order, garbled, duplicated packets may get there out of order, garbled, duplicated may not get there at all! may not get there at all! Unreliable datagram service Unreliable datagram service
21
IP Routing Hop-by-Hop How a Router Forwards Datagrams
22
Classless Interdomain Routing (CIDR) 0 2 32 -1
23
Classless Interdomain Routing (CIDR) 0 2 32 128.9/16 128.9.0.0 2 16 142.12/19 65/8 128.9.16.14
24
Classless Interdomain Routing (CIDR) 0 2 32 128.9/16 128.9.16.14 128.9.16/20128.9.176/20 128.9.19/24 128.9.25/24
25
Classless Interdomain Routing (CIDR) 0 2 32 128.9/16 128.9.16.14 128.9.16/20128.9.176/20 128.9.19/24 128.9.25/24
26
Five Minute Break
27
Network Programs host host ping ping traceroute traceroute nslookup nslookup
28
Summary of IP Connectionless/Datagram Connectionless/Datagram Unreliable/Best Effort Unreliable/Best Effort
29
Transmission Control Protocol
30
Characteristics Connection-Oriented Connection-Oriented Reliable Reliable Byte-Stream Byte-Stream Flow Control (aka Congestion Control) Flow Control (aka Congestion Control)
31
Three Phases Establish Connection Establish Connection Data Transfer Data Transfer Terminate Connection Terminate Connection
32
Establishing the Connection
33
Data Transfer
35
Maintaining the “Connection” IPHdr IP Data TCPHdrTCP Data SrcportDst port Sequence # AckSequence # HLEN 4 RSVD 6 URGACK PSH RSTSYN FIN Flags Window Size ChecksumUrgPointer (TCP Options) 01531 TCP Data Src/dst port numbers and IP addresses uniquely identify socket
36
Terminating the Connection Connection Close/Teardown 2 x 2-way handshake (Active) Client (Passive) Server Fin (Data +)Ack Fin Ack
37
Connection-Oriented Connection-Oriented Reliable Reliable Byte-Stream Byte-Stream Flow Control (aka Congestion Control) Flow Control (aka Congestion Control)
38
Reliability & Flow Control Sequence numbers & Acknowledgements (ACKs) Sequence numbers & Acknowledgements (ACKs) Receiver detects Corrupt, Lost, Duplicated, Out-of- order Receiver detects Corrupt, Lost, Duplicated, Out-of- order Tell sender which packets it has received correctly Tell sender which packets it has received correctly Sender can resend Sender can resend In Flight Window (Window Size) In Flight Window (Window Size) Sender only has N unacknowledged packets “in Sender only has N unacknowledged packets “in
39
Sending a Message
40
Connection-Oriented Connection-Oriented Reliable Reliable Byte-Stream Byte-Stream Flow Control (aka Congestion Control) Flow Control (aka Congestion Control)
41
UDP
42
User Datagram Protocol (UDP) Like TCP, in the Transport Layer Like TCP, in the Transport Layer Characteristics Characteristics Connectionless, Datagram, Unreliable Connectionless, Datagram, Unreliable Adds only application multiplexing/demultiplexing and checksumming to IP Adds only application multiplexing/demultiplexing and checksumming to IP Good for Streaming Media, Real-time Multiplayer Networked Games, VoIP Good for Streaming Media, Real-time Multiplayer Networked Games, VoIP
43
Summary IP is the basis of Internetworking IP is the basis of Internetworking TCP builds on top of IP adds reliable, congestion-controlled, connection- oriented byte-stream. TCP builds on top of IP adds reliable, congestion-controlled, connection- oriented byte-stream. UDP builds on top of IP allows access to IP functionality UDP builds on top of IP allows access to IP functionality
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.