0% found this document useful (0 votes)
54 views58 pages

Data Comm Part 3.ppt New

The document discusses IP addressing and subnetting. It defines what an IP address is and how addresses are allocated. It also explains the different IP address classes, subnet masks, private IP ranges, and transition from IPv4 to IPv6.

Uploaded by

muhabamohamed21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views58 pages

Data Comm Part 3.ppt New

The document discusses IP addressing and subnetting. It defines what an IP address is and how addresses are allocated. It also explains the different IP address classes, subnet masks, private IP ranges, and transition from IPv4 to IPv6.

Uploaded by

muhabamohamed21
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 58

IP addressing

• An IP address is a string of numbers separated by periods.


IP addresses are expressed as a set of four numbers for
example an address might be 192.158.1.38. Each number in
the set can range from 0 to 255. So, the full IP addressing
range goes from 0.0.0.0 to 255.255.255.255.
HOW TO GET IP ADDRESS?????
• IP addresses are not random. They are mathematically
produced and allocated by the
Internet Assigned Numbers Authority (IANA), a division of
the Internet Corporation for Assigned Names and Numbers
(ICANN). Each time anyone registers a domain on the
internet, they go through a domain name registrar, who pays
a small fee to ICANN to register the domain. 1
Internet service provider(ISP)
• In order to obtain a block of IP addresses for use within an
organization’s subnet, a network administrator might
first contact its ISP, which would provide addresses from a
larger block of addresses that had already been allocated to the
ISP.
• For example, the ISP may itself have been allocated the
address block 200.23.16.0/20. The ISP, in turn, could divide
its address block into eight equal-sized contiguous address
blocks and give one of these address blocks out to each of
up to eight organizations that are supported by this ISP.
• If you are configuring a host (computer):
• Manual configuration by system admin.
• Windows: Control panel  network configuration TCP/IP 
properties.

• DHCP (Dynamic Host Configuration


Protocol).
• Dynamically get address from server (plug-and-play).
• Once an organization has obtained a block of addresses, it can
assign individual IP addresses to the host and router
interfaces in its organization.
• Host addresses can also be configured manually, but more
often this task is now done using the Dynamic 3 Host
Configuration Protocol (DHCP).
Dynamic Host Configuration Protocol (DHCP)
• Allow a host to obtain its IP address automatically.
• Other information such as subnet mask and DNS server will
also be obtained automatically.
• Each subnet must have a DHCP server.
• Alternatively, the router must be configured so that it can relay
a DHCP request to a DHCP server on a different subnet.
• A DHCP server maintains a list of available IP addresses.
• A host that joins the network will be given an available IP
address from the list.
• When the host leaves the network, the IP address will be
returned to the list and again becomes available.

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.

• Two level class-full hierarchy


• Three level subnet hierarchy

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

The number of subnets must be


a power of 2.
Subnet design
• Four key points taken into consideration:
• How many total subnets does the organization need today?
• How many total subnets will the organization need in the
future?
• How many hosts are on the organization’s largest subnet
today?
• How many hosts will there be on the organization’s largest
subnet in the future?
• It is to take the maximum number of subnets required
and round up to the nearest power of two.
• To ensure that there are enough host addresses for the
organization’s largest subnet. 24
Classless Inter domain Routing (CIDR)
• CIDR is a system of IP addressing and routing that
solves the many problems of classful addressing by
eliminating fixed address classes in favor of a
flexible, hierarchical multiple level structure of
networks of varying sizes.
• Advantages of CIDR:
• Efficient address space allocation
• Elimination of class imbalances

25
Slash notation

Slash notation is also called


CIDR
notation.
A block in classes A, B, and C
can easily be represented in slash
notation as
A.B.C.D/ n
where n is
either 8 (class A), 16 (class B), or
24 (class C) or classless
Classless Inter domain Routing (CIDR)
• Since there are no address classes in CIDR, one can not tell
the size of the network ID of an address from the address
alone.
• IN CIDR the length of the network ID (prefix) is
indicating by placing it following a slash after the
address.
• This is called CIDR notation or slash notation.
• Example: 184.13.152.0/22. “22” means this network has 22
bits for the network ID and 10 bits for host address.
• Its subnet mask is 255.255.252.0 and has a total of 1022 (2
^ 10 – 2) hosts.
28
Classless Inter domain Routing (CIDR)
• Example:

• A middle size ISP has assigned an address 71.94.0.0/15, means


15 bits network ID and 17 bits host address.
• It was assigned from a large size ISP
• 71.94.0.0/15 has 131,070 possible host addresses (2^17-2).
• It is possible to create 2 subnets using 1 bite from the host part
= 71.94.0.0/16 and 71.95.0.0/16, each with 2^16-2 (65534)
host addresses.
29
p l e s
r e e x am
t h m o
ss w i
d d r e
IP a
Data Link Layer
• It is the responsible of node to node delivery of messages.
Functions of DLL
• Framing: The layer which divides the stream of packets
received from the network layer into manageable data units.
• Physical Addressing it adds physical address of sender and
receiver in the head of each frame.
• Error control and Flow control
32

Error control and Flow control


• The most important responsibilities of the data link layer are
flow control and error control.

• Error Control involves both error detection and error


correction.

• It is necessary because errors are inevitable in data


communication, in spite of the use of better equipment and

reliable transmission media based on the current technology.


Error
Single-bit error

Multiple-Bit Error:

33
Assignments
explain error correction and error detection mechanisms
with examples.(10%)

Error Detection mechanisms


 Parity Check

 CRC

 Check sum

Error correction mechanism

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.

• Is the process of rate of data transmission between two


nodes to prevent a faster sender from overwhelming a slow
receiver and it prevents receiver becoming overloaded.
• There are three methods that developed for flow control
1 Stop-and-wait
2. Go-Back N ARQ
3. Selective Repeat ARQ.
Stop-and-Wait ARQ
• A transmitter sends a frame then stops and waits for an
acknowledgment.

The sending device keeps a copy of the sent frame


transmitted until it receives an acknowledgment( ACK).

The sender starts a timer when it sends a frame. If an ACK is


not received within an allocated time, the sender resends it.

Both frames and acknowledgment (ACK) are numbered


alternately 0 and 1( two sequence number only).
36
Stop and wait protocols

RTT = Round Trip Time


Go Back N ARQ
• Go back –N retransmit all packets
• Based on sliding window
• Sliding window is a method for controlling transmitted data
packets b/n two network computers.

• 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

If ACK s are lost


0
1
Retransmission 2
Frame duplication!
3 39
Selective Repeat ARQ
• Go-Back-N ARQ is inefficient of a noisy link.
 In a noisy link frames have higher probability of damage ,
which means the resending of multiple frames.
 this resending consumes the bandwidth and slow down the
transmission .
Solution:
 Selective Repeat ARQ protocol : resent only the damage
frame
40
Explanation

Sender Receiver

Data-0

Data-1

Data-2

NACK-2 Frame-2 discarded


Retransmit Data-2 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.

Accept packets from a source station and deliver them to a


destination station.

•To accomplish this, a path or route through the network


must be determined.

•In general terms, routing seeks to design routes through


the network for individual pairs of communicating end
nodes such that the network is used efficiently.
44
Routing
• Recall: There are two parts to routing IP packets:
1. How to pass a packet from an input interface to the
output interface of a router?
2. How to find and setup a route ?

Forwarding means to place the packet in its route to its


destination.
It requires a host or a router to have a routing table. When a host
has a packet to send or when a router has received a packet to be
forwarded..

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

Distance Table RoutingTable


via
w n to via cost
to (next hop)

d C d (v,w) C d (v,n) d n D d (v)

In the graph, Cd(v,w)>Cd(v,n) and, therefore, Dd(v) =


Cd(v,n) where;

c(v,w) cost of link (w,v)


C d(v,w) cost from v to d via w
Dd(v) minimum cost from v to d
Count-to-Infinity
AA 1 BB 1 CC
• The reason for the count-to-infinity problem is that each node
only has a “next-hop-view”
• For example, in the first step, A did not realize that its route
(with cost 2) to C went through node B
• How can the Count-to-Infinity problem be solved?
• Solution 1: Always advertise the entire path in an update
message (Path vectors)
• Solution 2: Never advertise the cost to a neighbor if this
neighbor is the next hop on the current path (Split Horizon)

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

• Each node must be


• discover its neighbors
• measure the delay (cost) to its neighbors
• broadcast a packet with this information to all other nodes
• compute the shortest paths to every other router
• The broadcast can be accomplished by flooding
• The shortest paths can be compute with Dijkstra’s algorithm
Link State Routing: Basic principles
1. Each router establishes a relationship (“adjacency”) with its
neighbors
2.Each router generates link state advertisements (LSAs) which
are distributed to all routers LSA = (link id, state of the link,
cost, neighbors of the link)
3. Each router maintains a database of all received LSAs
(topological database or link state database), which
describes the network has a graph with weighted edges
4. Each router uses its link state database to run a shortest path
algorithm (Dijikstra’s algorithm) to produce the shortest path
to each network

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

You might also like