Download No Slide Title

Document related concepts

Net bias wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Piggybacking (Internet access) wikipedia , lookup

Internet protocol suite wikipedia , lookup

Peering wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Transcript
Department of Electronic Engineering
City University of Hong Kong
Internet Protocol (IP)
EE3900 Computer Networks
Internet Protocol (IP)
Slide 1
Department of Electronic Engineering
City University of Hong Kong
Outline
•
•
•
•
•
•
•
Motivation of Internetworking
Internet Protocol (IP)
IP Packets
Classes of Internet Address
Datagram Forwarding
IP Encapsulation and Address Resolution
Fragmentation and Reassembly
EE3900 Computer Networks
Internet Protocol (IP)
Slide 2
Department of Electronic Engineering
City University of Hong Kong
Motivation of Internetworking
• LANs
– low cost
– limited distance
• WANs
– higher cost
– unlimited distance
• No single networking technology is suitable for all
applications
• Organizations ended up with multiple standalone
networks, each designated for a specific task
EE3900 Computer Networks
Internet Protocol (IP)
Slide 3
Department of Electronic Engineering
City University of Hong Kong
Universal Service
•
•
•
•
•
Fundamental concepts in networking
Pioneered by telephone system
Arbitrary pair of computers can communicate
Desirable
Difficult in a heterogeneous world – hardware +
software, addressing scheme
EE3900 Computer Networks
Internet Protocol (IP)
Slide 4
Department of Electronic Engineering
City University of Hong Kong
Incompatibility
• Many different types of network
technologies are in wide-spread use today.
– They are incompatible.
Transport Layer
Network Layer
LLC layer
MAC Layer
EE3900 Computer Networks
LAN Technologies
Ethernet
FastEthernet
Gigabit Ethernet
Token Ring
Token Bus
Phonenet
FDDI
HIPPI
Fibre Channel
FireWire
ATM
Internet Protocol (IP)
WAN Technologies
X.25
SMDB
Frame Relay
ISDN, BISDN
ATM
Slide 5
Department of Electronic Engineering
City University of Hong Kong
Heterogeneity and Universal Service
• Incompatibility among networks:
–
–
–
–
–
–
electrical properties
singalling and data encoding
packet formats
addressing schemes
network access mechanisms
routing techniques
• Incompatibilities among network hardware and
physical addressing prevent an organization from
building a bridged network that includes arbitrary
technologies
EE3900 Computer Networks
Internet Protocol (IP)
Slide 6
Department of Electronic Engineering
EE3900 Computer Networks
City University of Hong Kong
Internet Protocol (IP)
Slide 7
Department of Electronic Engineering
City University of Hong Kong
An Internetwork
• Begins with heterogeneous networking technologies
• Connect the physical networks
• Using networking software to have a system appears
to be homogeneous
• An internetwork or internet
EE3900 Computer Networks
Internet Protocol (IP)
Slide 8
Department of Electronic Engineering
City University of Hong Kong
Connecting Heterogeneous Networks
• Computer system used
–
–
–
–
Special-purpose
Dedicated
works with LAN or WAN technologies
Known as
• internet gateway
• internet router
• or, simply, router
EE3900 Computer Networks
Internet Protocol (IP)
Slide 9
Department of Electronic Engineering
City University of Hong Kong
Illustration of an Internet Router
• Cloud denotes arbitrary network technology
• One interface per network
EE3900 Computer Networks
Internet Protocol (IP)
Slide 10
Department of Electronic Engineering
City University of Hong Kong
Important Idea
• A router can interconnect networks that use different
technologies, including different media, media access
techniques, physical addressing schemes, or frame
formats
EE3900 Computer Networks
Internet Protocol (IP)
Slide 11
Department of Electronic Engineering
City University of Hong Kong
Internet Architecture
• Multiple networks are interconnected by multiple routers
• Host computer connects to a network
• Single router for multiple networks may lack reliability
and insufficient
– CPU power and memory
– I/O capability
EE3900 Computer Networks
Internet Protocol (IP)
Slide 12
Department of Electronic Engineering
City University of Hong Kong
Goal of Internetworking
• Enable communication systems to be
–
–
–
–
Seamless
General purpose
Universal
Hides heterogeneity from users
EE3900 Computer Networks
Internet Protocol (IP)
Slide 13
Department of Electronic Engineering
City University of Hong Kong
The Internet Concept
EE3900 Computer Networks
Internet Protocol (IP)
Slide 14
Department of Electronic Engineering
City University of Hong Kong
To Hide Heterogeneity
• Create ‘virtual” network
• Invent
– addressing scheme
– naming scheme
• Implement networking protocol software
• Protocol software are needed on both the hosts and routers
EE3900 Computer Networks
Internet Protocol (IP)
Slide 15
Department of Electronic Engineering
City University of Hong Kong
Outline
•
•
•
•
•
•
•
Motivation of Internetworking
Internet Protocol (IP)
IP Packets
Classes of Internet Address
Datagram Forwarding
IP Encapsulation and Address Resolution
Fragmentation and Reassembly
EE3900 Computer Networks
Internet Protocol (IP)
Slide 16
Department of Electronic Engineering
City University of Hong Kong
Internet: History & Developments
• In mid-1960s, mainframe computers were
standalone devices, hardly any
communications between computers from
different manufacturers
• In 1960s US Defense Department’s Advance
Research Projects Agency (ARPA)
commissioned a project to link computers
together.
EE3900 Computer Networks
Internet Protocol (IP)
Slide 17
Department of Electronic Engineering
City University of Hong Kong
Internet: History & Developments
• In 1967, idea for ARPANET was formed
• In 1969, ARPANET linked 4 nodes together
• In 1973, Vint Cerf and Bob Kahn outlined
Transmission Control Protocol (TCP)
• In 1977, TCP was split into 2 protocols
(TCP/IP) with TCP responsible for reliable
transfer of data
EE3900 Computer Networks
Internet Protocol (IP)
Slide 18
Department of Electronic Engineering
City University of Hong Kong
Internet: History & Developments
• While Internet Protocol (IP) handles the format
and routing of datagram (independent packet)
• TCP became more popular as UC Berkeley
modified the UNIX operating system to
include TCP/IP in 1981
EE3900 Computer Networks
Internet Protocol (IP)
Slide 19
Department of Electronic Engineering
City University of Hong Kong
INTERNET Protocols
•
•
•
•
Commonly known as TCP/IP
Many protocols comprise a suite
Designed to work together
Divided into five conceptual layer
EE3900 Computer Networks
Internet Protocol (IP)
Slide 20
Department of Electronic Engineering
City University of Hong Kong
Layering used with TCP/IP
• Note: presentation and session layers of the OSI model
do not exist in TCP/IP
EE3900 Computer Networks
Internet Protocol (IP)
Slide 21
Department of Electronic Engineering
City University of Hong Kong
TCP/IP Protocols Suite
*
*
*
*
EE3900 Computer Networks
Internet Protocol (IP)
Slide 22
Department of Electronic Engineering
City University of Hong Kong
Internet Protocol (IP)
• The only layer 3 protocol in the suite
• Fundamental in the suite
• Facilitate to send packets across internet composed of
multiple routers
• Defines:
– Internet addressing
– Internet packet format
– Internet routing
EE3900 Computer Networks
Internet Protocol (IP)
Slide 23
Department of Electronic Engineering
City University of Hong Kong
IP Semantics
• IP is connectionless
– packet contains destination address
– each packet sent/handled independently
• Routes between sender and receivers can change at any time
EE3900 Computer Networks
Internet Protocol (IP)
Slide 24
Department of Electronic Engineering
City University of Hong Kong
IP Semantics (Cont’d)
• Allows packet to be
–
–
–
–
delayed
duplicated
delivered out-of-order
lost
• Called best effort service
• It is the responsibility of the next higher layer
(eg: TCP) to recover from any errors that occur
• Motivation: accommodate all possible networks
EE3900 Computer Networks
Internet Protocol (IP)
Slide 25
Department of Electronic Engineering
City University of Hong Kong
Outline
•
•
•
•
•
•
•
Motivation of Internetworking
Internet Protocol (IP)
IP Packets
Classes of Internet Address
Datagram Forwarding
IP Encapsulation and Address Resolution
Fragmentation and Reassembly
EE3900 Computer Networks
Internet Protocol (IP)
Slide 26
Department of Electronic Engineering
City University of Hong Kong
Motivation for IP Packets
• Because it connect heterogeneous networks, a router
cannot transmit a copy of a frame that arrives on one
network across another without changing the frame.
• To accommodate heterogeneity,
an internet must define a hardware-independent packet
format.
EE3900 Computer Networks
Internet Protocol (IP)
Slide 27
Department of Electronic Engineering
City University of Hong Kong
Internet Packets
•
•
•
•
Created and understood by the networking software
Contains sender and destination addresses
Size depends on data being carried
Called IP datagrams
EE3900 Computer Networks
Internet Protocol (IP)
Slide 28
Department of Electronic Engineering
City University of Hong Kong
The Two Parts of an IP Datagram
• Header
– 20 octets
– contains sender and destination addresses
– fixed-size fields
• Payload
– variable size, header+payload up to 64K octets
– no minimum size
EE3900 Computer Networks
Internet Protocol (IP)
Slide 29
Department of Electronic Engineering
City University of Hong Kong
IP Packet Header
• Three Key fields
– source IP address
– destination IP address
– type (of data)
EE3900 Computer Networks
Internet Protocol (IP)
Slide 30
Department of Electronic Engineering
City University of Hong Kong
Outline
•
•
•
•
•
•
•
Motivation of Internetworking
Internet Protocol (IP)
IP Packets
Classes of Internet Address
Datagram Forwarding
IP Encapsulation and Address Resolution
Fragmentation and Reassembly
EE3900 Computer Networks
Internet Protocol (IP)
Slide 31
Department of Electronic Engineering
City University of Hong Kong
IP Addressing
• Independent of hardware addressing
• Used by
– higher layer protocols
– applications
EE3900 Computer Networks
Internet Protocol (IP)
Slide 32
Department of Electronic Engineering
City University of Hong Kong
IP Address
• Used for all communications
• a 32-bit binary number
• Unique value for each network interface
– An IP address does not identify a specific computer.
– Each IP address identifies a connection between a computer
and a network. A computer with multiple network connections
(eg. a router) have one IP address for each connection
EE3900 Computer Networks
Internet Protocol (IP)
Slide 33
Department of Electronic Engineering
City University of Hong Kong
IP Address
• Divided into two parts
– Prefix identifies network
– Suffix identifies host
• Global authority assigns unique prefix to network
• Local administrator assigns unique suffix to host
EE3900 Computer Networks
Internet Protocol (IP)
Slide 34
Department of Electronic Engineering
City University of Hong Kong
Classes of Addressing Scheme
• Initial bits determine class
• Class determines boundary between prefix and suffix
EE3900 Computer Networks
Internet Protocol (IP)
Slide 35
Department of Electronic Engineering
City University of Hong Kong
Dotted Decimal Notation
•
•
•
•
Shorthand for IP Address
Use decimal instead binary numbers
Represents each octet in decimal separated by dots
NOT the same as names like www.somewhere.com
EE3900 Computer Networks
Internet Protocol (IP)
Slide 36
Department of Electronic Engineering
City University of Hong Kong
Example of Dotted Decimal Notation
• Four decimal values per 32-bit address
• Each decimal number
– represents eight bits
– between 0 to 255
• Question: 144.214.40.135 is an IP address belonging to CityU.
What is CityU’s network class type and network number?
EE3900 Computer Networks
Internet Protocol (IP)
Slide 37
Department of Electronic Engineering
City University of Hong Kong
Classes and Network Sizes
•
•
•
•
•
•
Maximum network size determined by class of address
Class A – (0 - 127) large
Class B – (128 -191) medium
Class C – (192 - 223) small
Class D – (224 – 239) multicasting
Class E – (240 – 255) reserved for future use
EE3900 Computer Networks
Internet Protocol (IP)
Slide 38
Department of Electronic Engineering
City University of Hong Kong
Addressing Example
EE3900 Computer Networks
Internet Protocol (IP)
Slide 39
Department of Electronic Engineering
City University of Hong Kong
Illustration of Router Addresses
• Address prefix identifies network
• Need one IP address per interface
EE3900 Computer Networks
Internet Protocol (IP)
Slide 40
Department of Electronic Engineering
City University of Hong Kong
Special Addresses
• Addresses never assigned to host
EE3900 Computer Networks
Internet Protocol (IP)
Slide 41
Department of Electronic Engineering
City University of Hong Kong
Outline
•
•
•
•
•
•
•
Motivation of Internetworking
Internet Protocol (IP)
IP Packets
Classes of Internet Address
Datagram Forwarding
IP Encapsulation and Address Resolution
Fragmentation and Reassembly
EE3900 Computer Networks
Internet Protocol (IP)
Slide 42
Department of Electronic Engineering
City University of Hong Kong
IP Datagram Forwarding
Conceptual routing table of R2:
• Performed by routers
• table-driven*, entry specifies next hop
• next-hop is either router or destination
*
how to construct routing tables is discussed in IP Routing Protocols
EE3900 Computer Networks
Internet Protocol (IP)
Slide 43
Department of Electronic Engineering
City University of Hong Kong
Example of an IP routing Table
• Table (b) is for center router in part (a)
EE3900 Computer Networks
Internet Protocol (IP)
Slide 44
Department of Electronic Engineering
City University of Hong Kong
Routing Table Size
• Because each destination in a routing table corresponds
to a network, the number of entries in a routing table
is proportional to the number of networks in an
internet
• In practice, a routing table contains a default route
that corresponds to all destinations not explicitly
listed. This technique keeps routing table sizes small.
EE3900 Computer Networks
Internet Protocol (IP)
Slide 45
Department of Electronic Engineering
City University of Hong Kong
Datagram Forwarding
• Given a datagram extracts destination address field, D
• find entry i such that ((Mask[i] AND D) == Destination[i])
and forward to NextHop[i]
• If no such an entry can be found, use the default route
• example: given D is 192.4.10.3, based on the example
routing table, 255.255.255.0 AND 192.4.10.3 == 192.4.10.0
128.1.0.9 is the next hop address.
• The use of mask in here seems trivial, but it is useful
when subnetting is deployed.
EE3900 Computer Networks
Internet Protocol (IP)
Slide 46
Department of Electronic Engineering
City University of Hong Kong
Key Concept
• The destination address in a datagram header always
refers to the ultimate destination. When a router
forwards the datagram to another router, the address of
the next hop does not appear in the datagram header
EE3900 Computer Networks
Internet Protocol (IP)
Slide 47
Department of Electronic Engineering
City University of Hong Kong
Outline
•
•
•
•
•
•
•
Motivation of Internetworking
Internet Protocol (IP)
IP Packets
Classes of Internet Address
Datagram Forwarding
IP Encapsulation and Address Resolution
Fragmentation and Reassembly
EE3900 Computer Networks
Internet Protocol (IP)
Slide 48
Department of Electronic Engineering
City University of Hong Kong
Datagram Delivery over a Single Network
• Once a next hop address has been found, IP software
transfers the packet across ONE physical network to
the selected host or router
• This is done by encapsulating the datagram in a physical
frame and sends the resulting frame directly to the selected
host or router
EE3900 Computer Networks
Internet Protocol (IP)
Slide 49
Department of Electronic Engineering
City University of Hong Kong
An Example
EE3900 Computer Networks
Internet Protocol (IP)
Slide 50
Department of Electronic Engineering
City University of Hong Kong
Illustration of IP Encapsulation
• Entire datagram treated like data
• Frame type identifies contents as IP datagram
• Frame destination address needs next hop hardware
address
• Note that the datagram AND the next hop IP address are passed to the
network interface hardware for packet delivery
EE3900 Computer Networks
Internet Protocol (IP)
Slide 51
Department of Electronic Engineering
City University of Hong Kong
Problem
• IP address cannot be used when transmitting frames
across physical network because the interfacing
hardware does not understand IP addressing
• Hardware only recognizes physical address
• Consequence: software needed to perform address
translation
– part of network interface
– known as address resolution
EE3900 Computer Networks
Internet Protocol (IP)
Slide 52
Department of Electronic Engineering
City University of Hong Kong
Address Resolution
• Layer 2 protocol
• Given
– a locally connected network, N
– IP address C of host/router on N
• Find
– physical address for C
• Technique
– Address Resolution Protocol
EE3900 Computer Networks
Internet Protocol (IP)
Slide 53
Department of Electronic Engineering
City University of Hong Kong
Address Resolution Protocol (ARP)
• Keep address bindings in table
• Table entry contains pair of addresses for one computer
– IP address
– physical address
• Build table automatically as needed
EE3900 Computer Networks
Internet Protocol (IP)
Slide 54
Department of Electronic Engineering
City University of Hong Kong
ARP Table
• Only contains entries for computers on local networks
• IP network prefix in all entries identical
EE3900 Computer Networks
Internet Protocol (IP)
Slide 55
Department of Electronic Engineering
City University of Hong Kong
ARP Look-up Algorithm
• Look for IP address, T, in ARP table
• If not found
– broadcast ARP request message
– receive reply with T’s hardware address
– add entry to table
EE3900 Computer Networks
Internet Protocol (IP)
Slide 56
Department of Electronic Engineering
City University of Hong Kong
Illustration of ARP Exchange
• W needs Y’s hardware address
• Request sent via broadcast
• Reply sent via unicast
EE3900 Computer Networks
Internet Protocol (IP)
Slide 57
Department of Electronic Engineering
City University of Hong Kong
ARP Message Format (for Ethernet)
• Length of hardware address fields depend on network
type
• Ethernet use 48-bit addresses
EE3900 Computer Networks
Internet Protocol (IP)
Slide 58
Department of Electronic Engineering
City University of Hong Kong
Sending an ARP Message
• ARP message sent in payload area of frame
EE3900 Computer Networks
Internet Protocol (IP)
Slide 59
Department of Electronic Engineering
City University of Hong Kong
Frame Type
• Frame type identifies message as ARP
• Receiver examines frame type to decide what action
should be taken
EE3900 Computer Networks
Internet Protocol (IP)
Slide 60
Department of Electronic Engineering
City University of Hong Kong
Important Note
• Because ARP software is part of the network interface
software, all higher layer protocols and applications can
use IP addresses exclusively, and completely
unaware of hardware addresses
EE3900 Computer Networks
Internet Protocol (IP)
Slide 61
Department of Electronic Engineering
City University of Hong Kong
Outline
•
•
•
•
•
•
•
Motivation of Internetworking
Internet Protocol (IP)
IP Packets
Classes of Internet Address
Datagram Forwarding
IP Encapsulation and Address Resolution
Fragmentation and Reassembly
EE3900 Computer Networks
Internet Protocol (IP)
Slide 62
Department of Electronic Engineering
City University of Hong Kong
Internet Transmission Paradigm
(General Case)
• Source host
– forms datagram
– includes destination address
– sends to nearest router
• Intermediate router
– forward datagram to next router
• Final router
– delivers to destination host
EE3900 Computer Networks
Internet Protocol (IP)
Slide 63
Department of Electronic Engineering
City University of Hong Kong
Illustration of Frame Headers Used
for Datagram Transmission
•Each hop extracts datagram
and discards frame
EE3900 Computer Networks
Internet Protocol (IP)
Slide 64
Department of Electronic Engineering
City University of Hong Kong
Maximum Frame Size
• Each network technology imposes maximum frame
size called Maximum Transmission Unit (MTU)
• In general, MTUs are different for different networks
• Internet
– contains heterogeneous technologies
– must accommodate multiple MTUs
EE3900 Computer Networks
Internet Protocol (IP)
Slide 65
Department of Electronic Engineering
City University of Hong Kong
How Two MTUs Cause a Problem for IP?
• Host 1
– creates datagram for host 2
– chooses datagram size of 1500 octets
– transmits datagrams across network 1
• Router R
– receives datagram over network 1
– must send datagram over network 2
– employs fragmentation
EE3900 Computer Networks
Internet Protocol (IP)
Slide 66
Department of Electronic Engineering
City University of Hong Kong
Datagram Fragmentation
•
•
•
•
•
•
Performed by routers
Needed when datagram is larger than MTU of network
Divides datagram into pieces called fragments
Each fragment has datagram header
Fragments are sent separately
Ultimately destination reassembles fragments
EE3900 Computer Networks
Internet Protocol (IP)
Slide 67
Department of Electronic Engineering
City University of Hong Kong
Illustration of Datagram Fragmentation
• Each fragment has the same IP datagram header
• Header fields
– identify the original datagram
– indicate where this fragment fits (Fragment Offset)
EE3900 Computer Networks
Internet Protocol (IP)
Slide 68
Department of Electronic Engineering
City University of Hong Kong
Example of Reassembly
•
•
•
•
Host H1 generates 1500-octet datagram
Router R1 fragments
Router R2 transmits fragments
Host H2 reassembles
EE3900 Computer Networks
Internet Protocol (IP)
Slide 69
Department of Electronic Engineering
City University of Hong Kong
Identifying a Datagram
• Fragments of a datagram may arrive out of order, destination
needs to know how to identify them
• Source places a unique ID in the IDENTIFICATION field of each
outgoing datagram
• When fragments are created, the ID is retained
• A bit in the FLAGS field indicate whether the datagram is a fragment
• Destination identifies fragments based on the ID and source IP
address
• the FRAGMENT OFFSET tells receiver how to order fragments
• IP specifies a max time to hold fragments (avoid in waiting lost fragments)
EE3900 Computer Networks
Internet Protocol (IP)
Slide 70
Department of Electronic Engineering
City University of Hong Kong
Multiple Fragmenting Points
• Let MTUs along internet be
–
–
–
–
–
–
1500
1500
1000
1500
576
1500
• Result: fragmentation can occur twice
EE3900 Computer Networks
Internet Protocol (IP)
Slide 71
Department of Electronic Engineering
City University of Hong Kong
Fragmenting a fragment
•
•
•
•
Needed when fragment is too large for network MTU
Arbitrary sub-fragmentation possible
Router divides fragments into smaller pieces
All fragments are at the same “level”
– Offset given with respect to original datagram
– Destination cannot distinguish sub-fragments
EE3900 Computer Networks
Internet Protocol (IP)
Slide 72
Department of Electronic Engineering
City University of Hong Kong
Fragment Loss
• Receiver
–
–
–
–
collects incoming fragments
reassembles when all fragments arrive
cannot identity the router which performed the fragmentation
cannot request missing pieces
• Consequences: loss of one fragment means the entire
datagram is lost
EE3900 Computer Networks
Internet Protocol (IP)
Slide 73