Data Comm Part 3.ppt New
Data Comm Part 3.ppt New
4
Internet Protocol Versions(IPv4 &IPv6)
Internet Protocol (IP) Version 4 or (IPv4) is currently the most
widely-used version of IP.
It is the only IP protocol that is used to carry user data over the
Internet.
IP version 6 (IPv6) is developed and being implemented in some
areas.
IPv6 will operate alongside IPv4 and may replace it in the future.
IPv4 basic characteristics:
Connectionless - No connection is established before sending data
packets.
Best Effort (unreliable) - No overhead is used to guarantee packet
delivery.
5
IPv4 addressing
• IP address is a 32 bit Internet address. .
• Unique 32 bit IP address is assigned to each host in the
Internet.
• Each device connected to the Internet must have a physical
(MAC) address and also a logical or Internet address.
• It is divided into two parts:
o First part identifies network (prefix).
o Second part identifies host (suffix).
• Global authority assigns unique prefix to network and
• Local administrator assigns unique suffix to host. 6
• Internet address designers (IPV4) decided to divide the IP
address space into five classes varying in their size.
• These are:
• Class A
• Class B
• Class C
• Class D
• Class E
• Each class fixes the boundary between the network prefix
and the host number at a different point within the 32 bit
address.
7
Finding the class in binary notation
Finding the address class
Finding the class in decimal notation
Netid and hostid
Class A networks ( /8 )
• Have 8 bit network prefix starting with 0 and 7 bit network
number, followed by 24 bit host number.
• A maximum of 126 (2 ^7-2) /8 networks can be defined.
• All zeros (00000000) is reserved for default route, & 127 is
reserved for the “loopback” (01111111).
• Each network supports a maximum of 16,777,214(2 ^ 24-2)
hosts.
• All zeros “for this network” and all ones for broadcast number
in each network.
12
Class B networks ( /16 )
• Has 16 bit network prefix starting with 10.
• 14 bit network number & 16 bit host number.
• A maximum of 2 ^ 14= 16,384 networks can be defined.
• 2 ^ 16-2= 65,534 hosts per network.
13
Class C networks ( /24 )
• Each network address has a 24 bit network prefix.
• Starts with 110 and 21 bit network number.
• A maximum of 2 ^ 21= 2,097,152 networks can be defined
with up to 2 ^ 8-2 = 254 hosts per network.
• Class C’s individual addresses is 2 ^ 29 = 536,870,912.
14
Dotted decimal notation
• Was devised to make Internet addresses easier for people
to read and write.
• Shorthand for IP addresses.
• Allows humans to avoid binary.
• Represents each byte in decimal separating by dots.
• Four decimal values per 32 bit addresses.
15
Dotted decimal notation
16
Reserved IPv4 Address Ranges
The IPv4 address range is 0.0.0.0 to 255.255.255.255= 2^32
Not all of these addresses can be used as host addresses.
Experimental Addresses
Ranges from 240.0.0.0 to 255.255.255.254. Reserved for special
purposes (research or experimentation).
Host Addresses
an address range of 0.0.0.0 to 223.255.255.255 is used for IPv4
hosts. However, within this range are many addresses that are
already reserved for special purposes.
17
Loopback Special IPv4 Addresses
is a special address that hosts use to direct traffic to
themselves.
Although only the single 127.0.0.1 address is used, addresses
127.0.0.0 to 127.255.255.255 are reserved.
Link-Local Addresses
These addresses can be automatically assigned to the local
host by the operating system in environments where no IP
configuration is available.
The address block is 169.254.0.0 to 169.254.255.255
TEST-NET Addresses
The address block 192.0.2.0 to 192.0.2.255 (192.0.2.0 /24) is set aside
for teaching and learning purposes. can be used in documentation
18
and network examples.
Default gateway
• Each PC is configured with an IP address and a default
gateway.
• The default gateway is the IP address of a router port on
the same network as the PC.
• It is the router’s job to handle messages to other networks.
• Each router port is on a different network and has a
different IP address.
19
Problems with IPV4 addressing
• The eventual exhaustion of IPV4 address space.
• The need to route traffic between the increasing number of
networks that comprise the Internet.
• Addresses are assigned to those asked without concerns of
their actual need, but according their request.
• Lack of a network class that support medium size
organizations. (/24 supports 254 hosts, too small, while /16
supports 65,534 hosts, too large).
20
Sub netting
• Sub netting is the process of creating new networks (or
subnets) by stealing/borrowing bits from the host portion of a
subnet mask. stealing bits from hosts creates more networks but
fewer hosts per network.
21
Subnet mask
• The subnet mask is created by placing a binary 1 in each bit
position that represents the network portion and placing a
binary 0 in each bit position that represents the host portion.
Identifies how much of the address spaces are used for the
network and for the host.
• Identifies Prefix / suffix boundary.
• 1 bits cover prefix and 0 bits cover suffix
• 10000010.00000101.00000101.00011001= 130.5.5.25/24
• 11111111.11111111.11111111.00000000 = 255.255.255.0
Default subnet mask for class A = 255.0.0.0
Default subnet mask for class B = 255.255.0.0
Default subnet mask for class C = 255.255.255.0
22
Comparison of a default mask and
a subnet mask
25
Slash notation
Multiple-Bit Error:
33
Assignments
explain error correction and error detection mechanisms
with examples.(10%)
CRC
Check sum
Hamming code
Flow control
• Flow Control refers to a set of procedures used to restrict
the amount of data that the sender can send before waiting
for acknowledgment.
• Assume GB4:
sender window size=4
We need at least sequence number=4
What happen during transmission of the frames? 38
Explanation- GB4
3• ...
2 1 0 Sender Receiver
0
0 1 2 3 0 1 2 3
1
Sender Receiver
Data-0
Data-1
Data-2
.
. Data-3
41
Physical Layer
• Provides physical interface between devices for
transmission of information.
• Covers all-mechanical, electrical, functional and
procedural - aspects for physical communication.
• Such characteristics as voltage levels, timing of
voltage changes, physical data rates, maximum
transmission distances, physical connectors.
• E.g: T-568A/B, 802.11, 1000BaseTx, 1000Base-
SX/LH
Responsibilities of physical layer
it coordinates the functions required to carry a bit stream over a
physical medium.
It deals with the mechanical and electrical specifications of the
interface and transmission medium.
defines the characteristics of the interface between the devices and the
transmission medium
defines the type of transmission medium
•Representation of bits: To be transmitted, bits must be encoded into signals--
electrical or optical.
defines the type of encoding (how 0s and 1s are changed to signals).
•Synchronization of bits: The sender and receiver not only must use the same
bit rate but also must be synchronized at the bit43 level
Routing
Routing is one of the most complex and crucial design aspects of
networks.
It involves two basic activities: determining optimal routing paths and
transporting packets through an internetwork.
45
Route method versus next-hop method
22.46
Shortest Path Routing protocol
Distance Vector
Each router sends a vector of distances to its
neighbours.
The vector contains distances to all nodes in the
network.
Link State
Each router sends a vector of distances to all nodes.
The vector contains only distances to neighbours.
Distance Vector
• Each router knows direct neighbors & link costs to neighbors
• Calculate the shortest path to each destination through an
iterative process based on the neighbors distances to each
destination
• Each node maintains two tables:
• Distance Table: Cost to each node via each outgoing link
• Routing Table: Minimum cost to each node and next hop
node
• Nodes exchange messages that contain information on the
minimum cost of a route.
Distance Vector
l(v,w)
v w d
50
Bellman-Ford Algorithm
• Find the least-cost paths from a given source node subject to
constraint that the paths contain at most one link, then find the
shortest paths with a constraint of paths of at most two links,
and so on.
• Finally, this algorithm returns the least-cost paths between any
pairs of nodes.
• s = source node
• w(i, j) = link cost from node i to node j
• w(i, i) = 0
• w(i, j) = if the two nodes are not directly connected
• w(i, j) 0 if the two nodes are directly connected
• h = maximum number of links in a path at the current stage of
the algorithm
• Lh(n) = cost of the least-cost path from s to n under the 51
constraint of no more than h links
Bellman-Ford Algorithm Method
Notation: h = Number of hops being considered
D(h)n = Cost of h-hop path from s to n
❑ Method: Find all nodes 1 hop away
Find all nodes 2 hops away
Find all nodes 3 hops away
❑ Initialize: D(h)n = ∞ for all n ≠ s; D(h)n = 0 for all h
❑ Find jth node for which h+1 hops cost is minimum
D(h+1)
n = minj [D(h)j +djn]
It means “the least-cost path from s to n of length h+1
is the least-cost path of length h, or it is actually a
length h+1 path, and before it reaches n, it passes
through j” 52
Bellman-Ford Equation
Define: Dx(y) := cost of least-cost path from x to y
Then Dx(y) = min {c(x,v) + Dv(y) }
• where min is taken over all neighbors v of x
5
• Example Du(z) = min {c(u,v) + Dv(z),
c(u,x) + Dx(z),
3 c(u,w) + Dw(z) }
2 v w 5 = min {2 + 5,
u 2
3
1 z 1 + 3,
5 + 3} = 4
1 2
x 1 y
53
Link State Routing
• each router knows complete topology & link cost information
• Run routing algorithm to calculate shortest path to each
destination
55
Dijkstra’s Algorithm
• Goal: Find the least cost paths from a given node to all other
nodes in the network
❑ Notation:
dij = Link cost from i to j if i and j are connected
• Dn = Total path cost from s to n
• M = Set of nodes so far for which the least cost path is known
❑ Method:
Initialize: M={s}, Dn = dsn
Find node w ∉ M, whose Dn is minimum
Update Dn
56
Dijkstra’s algorithm: example
Step start N' D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)
0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF
5
3
2 B C 5
A 2
3
1 F
1 2
D 1 E
57
Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)
0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADB 4,D 2,D infinity
3 ADBE 3,E 4,E
4 ADBEC 4,E
5 ADEBCF
Resulting forwarding table at A:
Resulting shortest-path tree for A:
destination link
5 B (A, B)
D (A, D)
3
B C 5 E (A, D)
2
A 2 1 F C (A, D)
3
1 F (A, D)
2
D E
1
CS118/Spring05 5/9/05 58