Documente Academic
Documente Profesional
Documente Cultură
Initiated by ARPA of DOD in 1969 to establish a packetswitching network linked by point-to-point leased lines
A standard protocol used for interoperability among
different types of computers (internetworking). An internet
under TCP/IP operates like a single (virtual) network
connecting computers of any size and type
Primary disadvantages of TCP/IP are its size and speed
(twice the size of NetBEUI)
Connection-Oriented vs.
Connectionless Service
Connection mapped
through network (requires
call setup)
Abbreviated addressing
(virtual circuit identifier)
Usually fixed routing
(virtual circuit) between
networks
More reliable (flow & error
control)
Internet Ports
A TCP upper-layer application in a host machine is
identified by a port number. The port number is
concatenated with the IP address to form a socket. A pair of
sockets uniquely identifies each end point connection
The port numbers are divided into:
The well-known ports (0 1023), assigned by IANA
The registered ports (1024 49151)
The dynamic and/or private ports (49152 65535)
(Including header)
(optional)
TCP Operation
TCP is an end-to-end protocol and uses IP to carry traffic
TCP is network-independent
TCP Segment
TCP header
Connection termination
acknowledgements
retransmissions
Timers (frame retransmit timer, delayed Ack timer, etc.)
Sequence numbers
Go back n or selective
repeat?
IP
To accommodate heterogeneity, an internet must define a
hardware-independent packet format
IP is connectionless service, no circuit is established
In IPv4, a datagram can contain as little as a single octet of
data or at most 64K octets, including header
Routers extract destination address from header and use
routing table to determine the next hop. Each destination in a
routing table is a network, not an individual host
Best-effort delivery: because IP is designed to operate over
all types of network hardware, the underlying hardware may
misbehave and datagrams may be lost, duplicated, delayed,
delivered out of order, or delivered with corrupted data.
There is no retransmission mechanism. Higher layers of
protocol software are required to handle each of these errors
IP Header
IP version
Header length: measured in 32-bit words, usually 5 (20 B)
TOS: identify several QOS functions requested by sender
Total length: measured in octets (max: 65,536)
Identification, flags, and fragmentation offset are used to
control datagram fragmentation and reassembly
TTL: number of hops to prevent endless loops
Protocol: to identify the next-layer protocol (UDP, TCP,
ICMP, IGMP, OSPF)
Header checksum is used to detect header error
Options: record route, source route, and timestamp option
Not all vendors support TOS. Typically, RIP ignores TOS bits,
but OSPF can route according to TOS requests
Fragmentation
All fragments have the same identification field
Flags are used
as follows:
Time-to-Live Field
IP Protocol Numbers
Header Checksum
The following checksum procedure is used in IP,
TCP, UDP, ICMP, and IGMP:
Set checksum field to 0
Calculate 16-bit 1s complement sum of the header
Store the sum in the checksum field
At receiver, calculate 16-bit 1s complement of the
header
5. The sum should be all 1s if header has not been
changed
1.
2.
3.
4.
Checksum Exercise
To send data string 110011111011101101110010
with segment length of eight, compute the
checksum ________________. Verify your answer
if you are the receiver
_______________________
Major IP Services
Header Check Routine
Valid IP header length, version number, message length,
header checksum, nonzero TTL
Routing (based on destination IP address)
Fragmentation and reassembly
IP Addressing
An addressing scheme that assigns each host a unique
protocol address
Uniform addressing for all hosts, an internet addressing
scheme is an abstraction created by software and is
independent of the underlying physical addresses
Addressing scaling issues: address space and ability to route
Solutions:
Subnetting
Private addressing
CIDR
IPv6: 32 bit (IPv4), 128 bit (IPv6)
Classes of IP Addresses
32-bit IP address is divided into two parts: a prefix
(identifies network) and suffix (identifies an individual
computer on that network) to make routing efficient, ex.
128.10.255.54
1st octet
1 -126
128 -191
192 -223
224 -239
240 -255
-2
-2
-2
-2
-2
-2
Special IP Addresses
Special addresses are reserved and should never be assigned
to host computers
NAT
NAT has another advantage security. Attackers cant go
after machines they cant see and private addresses arent
visible on the Internet
The trade-off is added cost, extra administration, and a
performance penalty
Subnetting
Class A and sometimes class B addresses can be wasteful. In
1985, RFC 950 defined a standard procedure to support
subnetting
The subnet structure of a network is never visible outside.
All subnets use the same network-prefix and only the
routers within the private organization need to differentiate
between the individual subnets. This allows the local
administrator to introduce arbitrary complexity into the
private network without affecting the size of Internets
routing tables. For example, a class B address such as
172.16.0.0, the organization could split this address into up
to 254 subnets by using addresses like 172.16.1.0,
172.16.2.0, and so forth up to 172.16.254.0
Subnet Example
The host portion of the internet address is partitioned into a
subnet number and a host number by using a subnet mask to
accommodate subnetting
CIDR
Classless Inter-Domain Routing (CIDR) was documented in
1993 in RFCs 1517 - 1520
Instead of having 3 classes, CIDR allows the division
between prefix and suffix to occur on an arbitrary boundary.
This gives ISPs more flexibility in handing out addresses.
For example, an ISP could elect to subdivide the /16 block
into two /17 blocks, or into four /18 blocks
CIDR is required for operations between autonomous
systems (network administered by a single ISP). It permits
networks to be grouped together logically, and to use one
entry in a routing table for multiple networks. For example,
with a mask of 254.0.0.0 (/7), all addresses between
194.0.0.0 and 195.255.255.255 can be identified by a single
entry in the routing table (route aggregation)
Subnet Example
Assume that you have been assigned the IP address 128.1.0.0.
a). Identify the IP address class. How many host addresses are
there?
b). If the above address has the CIDR block prefix of /20,
give the subnet mask. How many subnets are there? How
many host addresses are there? How many addresses are
lost by the subnetting process?
c). What are the range of addresses you may assign for subnet
#1?
Supernets
Subnets divide address into segments and supernets
combine addresses into a block (address aggregation)
Supernets steal bits from the network portion of an IP
address to lend those bits to the host part it permits
multiple IP addresses to be combined and make them
function as a single logical network
In order to create supernets from class C IP addresses, the
network addresses must be consecutive and the first
addresss third octet must be evenly divisible by 2
Classless routing protocols are needed to support supernets
Supernetting is a useful tool for ISPs who can combine
multiple Class C addresses to serve a larger population than
might seem possible
Supernet Examples
201.41.18.0 and 201.41.19.0 can be combined into a
supernet 201.41.18.0/23 and 201.41.18.0 network being
supernet 0 and 201.41.19.0 network being supernet 1
201.41.15.0 and 201.41.16.0 cannot be combined into a
supernet
For additional examples of supernets, refer to the RFCs
1338, 1518, and 1519
An Example of IP Routing
1st match eliminates all entries in which
the masked part of the destination address
is not identical to the masked part of the
destination address field in the table
Keep the remaining entries in the pruned
table that have the longest mask
Perform the longest match. If more than
one entry remains, the route taken may
depend on TOS metrics or network
administrators policy
Because of this overhead, the high-end
routers use label-switching (MPLS)
IP Address Configuration
For a computer to connect to the Internet, it must have the
following information in its configuration file:
IP address
Subnet mask
Routers IP address
Name servers IP address
IP Forwarding Process
An IP Network
Example
Address Resolution
IP address must be translated to an equivalent hardware
address (MAC address) when transmitting frames across
physical network hardware
Mapping between an IP address and a MAC address is
called address resolution
A host or router uses address resolution when it needs to
send a packet to another computer on the same physical
network. A computer never resolves the address of a
computer that attaches to a remote network (ARP is not an
IP protocol, namely ARP datagrams do not have IP headers
and will not be forwarded by routers)
RARP
Allows a host to discover its IP address when it
knows only its physical MAC address
Used when the host is a diskless computer (usually a
host has its IP stored in a configuration file on its
hard disk where the OS can find it at boot), when
the computer is connected to the network for the
first time (when it is being booted), etc.
Packet Fragmentation
Fragmentation Example
Reassembly Example
The following figure shows the fragmented datagrams
arrive from gateways Y and Z in the order depicted by the
time from n to n + m
ICMP
Internet Control Message Protocol (ICMP) is required for a
standard implementation of IP (RFC0792)
IP uses ICMP when it sends an error message (from router
to source) and ICMP uses IP to transport messages
ICMP error messages can be used to test an internet to
obtain information (reachable destination? Trace a route?
Path MTU discovery?)
In addition to error reporting, ICMP can diagnose some
network problems through query messages such as echo
request and reply, time-stamp request and reply, address
mask request and reply, and router solicitation and
advertisement
IGMP
IP addressing supports multicasting. All 32-bit IP addresses
that start with 1110 (class D) are multicast addresses. 228 =
256 M group addresses are available
IGMP is designed to help a multicast router identify the
hosts in a LAN that are members of a multicast group. IP
hosts and multicast routers communicate multicast group
membership information by exchanging IGMP messages
IP multicasting is critical to many applications, such as
interactive teleconferencing, on-line training, and electronic
distribution of software and information
IPv6 (IPng)
IPv4 has been extremely successful the protocol has
accommodated changes in hardware technologies and
heterogeneous networks
Motivations for changes (IP v4 deficiencies):
Limited address space
New Internet applications
real-time delivery of audio and video
collaboration technologies to allow group
communications that require more complex addressing
and routing capabilities
Accommodate data encryption and authentication of
data
Refers to RFCs 1924, 1883
Fragmentation
Fragmentation information is not in the base
header, IPv6 places them in a separate fragment
extension header
In IPv6, a sending host is responsible for
fragmentation instead of routers. The host must
learn the MTU of each network along the path to
the destination and choose a size to fit the smallest
(path MTU discovery procedure)
IPv6 Addressing
Summary of IPv6
Same primary functions as IPv4, providing a connectionless
routing capability
Added capabilities such as authentication and encryption to
provide security
Increases the address space dramatically
Simplifies the headers to make routing more efficient
Intermediate nodes no longer fragment packets
There is no error detection (checksum) capability in IPv6,
thus relieving routers of another time-consuming task
Example of
TCP/IP
Topology
Routers A and F
are multi-protocol
routers who can
process either
SNA or IP packet
Broad connectivity
Direct access to Internet
Strong support for routing
SNMP
Support for DHCP
Support for most other
Internet protocols
Review Questions
1.
2.
3.
4.
5.
6.
7.
Homework
1.
2.
3.
4.