Transcript Networking
Networking
An Introduction
History of the Internet
ARPAnet
• Advanced Research Project Agency
• First four nodes – 1969
• Connect supercomputers
DARPAnet
• Defense Advanced Research Project
Agency
• Replaced ARPA and took over network
History of Internet (2)
NSFnet
• Merged NSF network and DARPAnet
when defense community moved to
more secure network. (Internet)
• Early 1990’s, administration of Internet
moves to public utilities.
†Based
upon Null and Lobur, Computer Organization and Architecture, Jones and Barttlett, 2003.
Characteristics of Internet
Originally designed to survive
thermonuclear war
Adopted datagrams that could be
individually routed
Uniform protocol over dissimilar
hardware
Philosophy of free and open
information interchange
TCP/IP Protocol
Three layered protocol
• Process layer
Application uses protocol from TCP/IP suite
FTP
HTTP
STMP
TELNET
• TCP layer
• IP layer
TCP/IP Architecture
IP
Header
Network
Header
†Based
IP
Header
User data
Application
TCP
Header
User data
TCP Segment
TCP
Header
User data
TCP
Header
User data
IP Datagram
Network Layer
(e.g. Ethernet)
upon Stallings, Data and Computer Communications, Prentice-Hall, 1997.
IP
Internet Protocol
Two versions
• IPv4
• IPv6
Divides packets into units called
datagrams
Adds Routing Information
Purpose – route datagrams over
network
IP Routing
Send Message
`
Datagram 1
Datagram 1
Datagram 2
`
Receive Message
IPv4 Datagram Header
Header length - minimum of 5 - 32 bit words
Word 1
•
•
•
•
Version – IP version
Header Length – in 32 bit words (min is 5)
Type of Service - priority
Total Length of datagram – total length (65,535 max)
Word 2
• Packet Id – number assigned as placed on network
• Flags – can packet be broken to smaller fragments
• Fragment offset – offset of fragment in original
datagram
IPv4 Datagram Header (2)
Word 3
• Time to Live (TTL) – number of hops left
in datagram lifetime
• Protocol Number – higher level protocol
sending packet
• Header Checksum
Word 4 – Source IP address
Word 5 – Destination IP address
Word 6 – IP options
IPv4 Address Classes
Three Classes of addresses
• Class A network
• Class B network
• Class C network
IP address 32 bits long
Uses dotted decimal notation
• 4 groups each representing 8 bits
• E.g. 168.47.23.8
Class A Networks
Format
•
•
•
•
0|Network|Host
High bit: 0
Network: 7 bits
Host: 24 bits
Reserved networks
• 127.x.x.x – loop back address
• 0.0.0.0 – default route
126 Networks
• 0.x.x.x to 127.x.x.x
Each has 224 (16.7 million) nodes
10.x.x.x is internal network number
Class B Networks
Format
• High two bits: 10
• Network: 14 bits
• Host 16 bits
214 (16,382) networks
• 128.0.x.x to 191.255.x.x
216-2 (65,534)hosts per network
168.x.x.x is internal IP
Class C Network
Format
• High three bits: 110
• Network: 21 bits
• Host 8 bits
221 (2,097,152)Networks
• 192.0.0.x to 223.255.255.x
28 (256) Hosts per network
192.x.x.x is an internal network
number
IPv4 Problems
65,536 byte packet is too small
• Can pass router in 1Gb network in less than 1
ms
Too few Addresses
• 126 Class A with 16.7 million nodes each – too
large
• Class C address has only 256 nodes – too
small
Typical Backbone routing table must
contain ~70,000+ routes
Transmission Control Protocol
TCP uses services provided by IP
More sophisticated than IP
TCP opens a connection – conservation
Service Access Port
• SAP - numerical
• Socket - SAP, host ID, and protocol designation
• Ports 0 – 1023
Well known ports
Use is reserved (e.g. 23 used by Telnet)
• Ports 1024 – 65,535
User defined
Transmission Control Protocol
Is reliable
TCP assures
• Proper sequence
• No duplicates
• Overflow prevented (transmission
speed)
• Connection-oriented
• Retransmission of lost data
TCP: Three-way Handshake
A
B
Open Connection
• SYN – Synchronize
T
i
m
e
ACK – Acknowledge
Note the
acknowledgement of
each msg
Negotiate connection
w. sequence numbers
next seq# t+2 for A,
and j+2 for B
Establishes connection
Windows and Payload Size
Window
• Number of bytes to send between
acknowledgements
• i.e. send window size bytes before
expecting an ACK to be returned
Payload Size
• Number of bytes sent in each packet
Negotiated after connection is
established
TCP Data Transfer
B Window = 500 bytes
Payload = 100 bytes
A
A can now send packets 300
to 600 w/o acknowledgement
TCP Segment Format
Word 1
• Source Port – 16 bits
• Destination Port – 16 bits
Word 2 – Sequence Number
Word 3 – Acknowledgement Number
Word 4
•
•
•
•
Data Offset – Number of 32-bit words in header
Reserved
Flags – URG, ACK, PSH, RST, SYN, FIN
Window – 16 bits
Word 5
• Checksum – 16 bits
• Urgent Pointer 16 bits
Word 6 Options
IPv6 Protocol
Addresses the Class B Problem
32 addresses
IPv4 – 2
IPv6 – 2128 addresses
• 2128 - 1 oz NIC → 1.61 quadrillion x
mass earth
• That’s enough addresses!
Requires management
Implementation by 2010
IPv6 Address Organization
Aggregatable Global Unicast Address
Format
Organization
• High 3 bits – flag indicating AGUA addr.
• Next 13 bits
Top-Level Aggregation (TLA) ID
Country, major global telecomm carrier
• Next 8 bits –Reserved (growing room)
• Next 24 bits
Level Aggregation (NLA) ID
Large company, government, ISP
IPv6 Address Organization (2)
• Next 16 bits
Site-Level Aggregation Id
Can break up addresses into 65,536 sub-netwroks
• Next 64 bits
Specify host
Each sub-network can have 264 hosts
Stateless Address Autoconfiguration
• Use 48 bit MAC address
• Completes address with net. info. from nearby
router
Prevents address spoofing
Has a transitional phase
Network Devices
Hub
• Physical layer
• Input port copied to all output ports
• Non-switched Ethernet
Switches
• Create point-to-point connection between input port and
one output port
• Switched Ethernet
Bridges
• Both networks must be same type
Gateways
• Point of entrance to a network
• Connects networks using different protocols
Routers
Connected to at least two networks
Determines the destination to which
a packet should be sent
Layer 3 Device
• Switch at the OSI Network layer
• Can bridge different network media
Computer that implements a routing
algorithm
Routing
NP-complete problem
• Consider a complete graph
• Number of simple paths between any two nodes – N!
Add finding the best path
Best
• Shortest?
• Fastest?
Routing information must be kept dynamically
Very hard but important task
Types of Routing Algorithms
• Distance-Vector Routing
• Link State Routing
Distance Vector Routing
`
`
`
M
L
D
`
`
B
• Dest
• Next Hop
• Hop Count
N
4
1
r
3
2
`
T
`
C
`
`
`
W
A
R
Each router keeps
table
Table
Routers exchange
hop information
with each neighbor
Based upon Fig. 11.21 from Null, Computer Organization and Architecture, Jones & Bartlett, 2003
Distance Vector Routing Tables
Router 2
Router 3
Router 1
Dest
Next
Hop
Hop
Count
Dest
Next
Hop
Hop
Count
Dest
Next
Hop
Hop
Count
A
--
0
A
R3
1
A
R2
2
B
R4
1
B
R3
2
B
R4
1
C
R2
1
C
--
0
C
R2
1
D
R4
1
D
R3
2
D
R4
1
L
R4
2
L
R1
1
L
--
0
M
R4
2
M
R1
1
M
--
0
N
R4
2
N
R1
1
N
--
0
R
R2
1
R
--
0
R
R2
1
T
--
0
T
R3
1
T
R4
2
W
--
0
W
R3
1
W
R4
2
Based upon Fig. 11.21 from Null, Computer Organization and Architecture, Jones & Bartlett, 2003
Distance Vector Routing Problems
Long time for routing tables to
stabilize
Considerable traffic to keep tables
updated
Obsolete routes
• Count-to-infinity problem
• Cycles in the routing can cause each to
keep updating hop count until infinite
value results