You are on page 1of 44

Chapter Four

Addressing and LAN Design


ADDRESSING
• Four levels of addresses are used in an
internet employing the TCP/IP protocols:
physical (link) addresses, logical (IP)
addresses, port addresses, and specific
addresses.

Fig 4.1 Addressing in TCP/IP


Addressing cont…
• Relationship of layers and addresses in TCP/IP
Addressing cont…
 Physical Addresses
• The physical address, also known as the link address, is
the address of a node as defined by its LAN or WAN. It is
included in the frame used by the data link layer. It is the
lowest-level address.
• The physical addresses have authority over the network
(LAN or WAN). The size and format of these addresses
vary depending on the network. For example, Ethernet
uses a 6-byte (48-bit) physical address that is imprinted on
the network interface card(NIC).
• LocalTalk (Apple), however, has a I-byte dynamic address
that changes each time the station comes up.
Addressing cont…
 Logical Addresses
• Logical addresses are necessary for universal communications that
are independent of underlying physical networks. Physical
addresses are not adequate in an internetwork environment where
different networks can have different address formats. A universal
addressing system is needed in which each host can be identified
uniquely, regardless of the underlying physical network.
• The logical addresses are designed for this purpose. A logical
address in the Internet is currently a 32-bit address that can
uniquely define a host connected to the Internet. No two publicly
addressed and visible hosts on the Internet can have the same IP
address.
• Note: During routing the physical addresses will change from hop
to hop, but the logical addresses usually remain the same.
Addressing cont…
Port Addresses
 The IP address and the physical address are necessary for a quantity of
data to travel from a source to the destination host. However, arrival at
the destination host is not the final objective of data communications on
the Internet. A system that sends nothing but data from one computer to
another is not complete. Today, computers are devices that can run
multiple processes at the same time. The end objective of Internet
communication is a process communicating with another process. For
example, computer A can communicate with computer C by using TELNET.
At the same time, computer A communicates with computer B by using
the File Transfer Protocol (FTP). For these processes to receive data
simultaneously, we need a method to label the different processes.
 In other words, they need addresses. In the TCPIIP architecture, the label
assigned to a process is called a port address. A port address in TCP/IP is
16 bits in length.
 Note that although physical addresses change from hop to hop, logical
and port addresses remain the same from the source to destination.
Addressing cont…
 Specific Addresses
• Some applications have user-friendly addresses that
are designed for that specific address. Examples
include the e-mail address (for example,
forouzan@fhda.edu) and the Universal Resource
Locator (URL) (for example, www.mhhe.com). The first
defines the recipient of an e-mail ; the second is used
to find a document on the World Wide Web. These
addresses, however, get changed to the corresponding
port and logical addresses by the sending computer.
IP Addressing
Every device connected to a TCP/IP network has a unique IP address bound to its
network interface.
 IP address is 32-bit long.
• It is usually written as four decimal numbers separated by dots (periods)
(dotted decimal notation)
• In hex, each of the four hexadecimal numbers is called an octet.
Example: 137.207.192.003 or 89 CF C0 03
• An IP address contains a network part and a host part.
• The number of address bits used to identify the network, and the number
to identify the host, vary according to the class of the address.
• Routers or gateways have one or more addresses(depending on the no. of
links they have) .The three main address classes are class A, class B, and
class C.
• By examining the first few bits of an address, IP software can quickly
determine the address class, and therefore its structure.
IP Addressing
Note:
For Class A: Have a first dotted decimal number in the range 1-126
Few networks, each with many hosts
For Class B: Have a first dotted decimal number in the range 128-191
Medium number of networks with a medium nos of hosts
For Class C: Have a first dotted decimal number in the range 192-223
Many networks, each with a few hosts
Class D: a multicast address. (224.0.0.0 - 240.0.0.0)
Class E: reserved for future use.(241.0.0.0 - 248.0.0.0)
IP addressing (cont’)
Class A
 If the first bit of an IP address is 0, it is the address of a class A
network.
 The first bit of a class A address identifies the address class. the
next seven bits identify the network, and the last 24 bits identify
the host.
 There are fewer than 128 class A network numbers, but each class
A network can have millions of hosts.
 The number of class A networks can be 2 7 = 128. Number 0 is not
used, and number 127 is used for testing loopback for each host.
There are 126 potential Class A network numbers, which have a first
dotted decimal number in the range 1 to 126.
 Therefore, each Class A network can have 2 24 = 16,777,216 hosts.
 Class A is not available to the general public, and it is restricted to
special uses.
Class B
 If the first two bits of the address are 1 and 0, it is a class B network
address. The first two bits identify class; the next fourteen(14)
bits identify the network, and the last sixteen (16) bits identify the
host.
 There are thousands of class B network numbers, each class B
network can have thousands of hosts. First two bits are used to
determine the class to which an address belongs to for class B
address 14 (6 + 8) bits are used for network address.
 Therefore, the number of class B networks can be 2 14 = 16,384.
There are 16,384 potential Class B network numbers, which have a
first dotted decimal number in the range 128 to 191.
 16 bits are used for host address. Therefore, each Class B network
can have 2 16 = 65,536 hosts.
Class C
• If the first three bits of the address are 1 1 0, it is a class C
network address. The next 21 bits are for the network
address. The last eight bits(8) identify the host.
• There are millions of class C network numbers. However,
each class C network can have 254 hosts.
• First three bits are used to determine the class to which an
address belongs to for class C address, 21 (5 + 16) bits are
used for network address.
• Therefore, the number of class C networks can be 2 21 = 2,
097,152. There are 2,097,152 potential Class C network
numbers, which have a first dotted decimal number in the
range 192 to 223. 8 bits are used for host address.
Therefore, each Class C network can have 28 = 256 hosts.
Loopback Address
• IP defines a loopback address used to test network applications.
• Programmers often use loopback testing for preliminary
debugging after a network application has been created.
• To perform a loopback test, a programmer must have two
application programs that are intended to communicate across a
network.
• Each application includes the code needed to interact with
TCP/IP protocol software.
• Instead of executing each program on a separate computer, the
programmer runs both programs on a single computer and
instructs them to use a loopback IP address when
communicating.
Loopback Address …cont’
 When one application sends data to another, data travels
down the protocol stack to the IP software and then IP
software forwards it up through the protocol stack to the
second program.
 Thus programmer can test the program logic quickly
without using two computers and without sending packets
across the network.
 During loopback testing, packets do not leave a computer
and the IP software forwards the packets from one
application to another application.
 The loopback address never appears in a packet travelling
across a network.
Limited Broadcast Address
 Refers to a broadcast on a local physical network.
 Informally, the broadcast is limited to a “single wire”.
 Limited broadcast is used during startup by a
computer that does not yet know the network
number.
 IP reserves the address consisting of all 1 bits to
refer to limited broadcast.
 IP will broadcast any packet sent to the all-ones
address across the local network.
IPV4 addressing cont’
• In hierarchical addressing , the higher level of
the addresses are retained with a sub-network
level and then the host level.
Network portion Host portion

8bit 8bit 8bit 8bit

• To communicate with device on another network a host uses the address


of this gateway or default gateway to forward a packet outside the local
network .
• The router examines the network portion of the packet destination
address and forward address and forward the packet to the appropriate
interface.
 A router knows hosts in the same network and other network
 Host knows other hosts within the same network but not networks.
Subnets and Subnet Masks
 Subnetting is the process of dividing network into the smaller networks
based on the IP address.
 The concept of subnetworks (subnets) was introduced to improve both
the address space use and the scaling properties of the IP routing system.
 Subnet mask is a 32-bits long address used to distinguish between
network address and host address IP address. It is always used with IP
address
 The purpose of sunetmask is to which part of the IP address is
network address and which apart is host address.
 Bit 1 represents network address while bit 0 represent host
address.
 To create subnet we borrow bits from host portion and
assign them as network bits .
 We can’t assign the network Id and the broadcast address to
a host.
Subnetting (cont’)
 Why subnetting?
 Preservation of address space
 Control network traffic, avoid collisions
 Reduce the routing complexity
 Improve network performance
 Security
 Advantages of subnetting
 It break large network into smaller networks and smaller
networks are easier to manage .
 It reduces network traffic by removing collusion and broadcast
traffic that improve overall performance.
 It allows you save money by reducing requirement for IP range.
Sub-netting
 Subnetting is a technique used to allow a single IP
network address to span multiple physical networks.
IP hosts should support subnetting.
 Subnetting is done by using some of the bits of the
host-id part of the IP address as a physical network
identifier.
 The subnet mask is used to determine the bits of the
network identifier.
 All hosts on the same network should have the same
subnet mask.
 The IPV4 host address is logically ANDed with its
subnet mask to determine the Network Address.
Subnet (cont’)
Example1: Write down the 32-bit address and the subnet mask of
(174.24.4.176/26 ).

Example2 : determine the subnet mask address of 188.25.45.48/20?


Solu: the address belong to class B and there are 20 bits assigned to the network
, hence netwwork bits will 1 and hosts bit will be zero (0)
11111111.11111111.11110000.00000000
Converting into decimal we have the subnet mask as 255.255.240.0
Example 3: In given Ip address 192.168.1.0/27. How many subnets
can be created ?
Solu: since we have borrowed only three bits from host part, then
number of subnets = 2^n= 2^3= 8 subnets
Subnet (cont’)
• Block size for subnet and valid subnets
Example4: Calculate the block size and the valid subnets for
given IP address 192.168.1.0/26.
Solu: borrowed bits =2 , total subnets=2^2=4
subnet mask would be =255.255.255.192
Block size would be =256-192=64
Valid subnets would be 0, 64, 128,192
Example5: What are the broadcast and the network addresses of the above
example .
Solu: 63, 127,191,255 broadcast address respectively
0,64,128,192 are network address respectively.
Broadcast address is the last address of subnet. It is reserved for network
broadcast, and it can’t be assigned to any host .
The network address also can’t be assigned to the network.
Subnet (cont’)
Exercise: For the following given iP address and
netmask. Determine the subnet address,
usable host addresses , and broadcast
address.
a) IP address: 164. 2.34.35 and subnet mask
255.255.255.224.
b) IP address: 101.2.3.18 and subnet mask
255.255.0.0.
IP - The Next Generation (IPng - IPv6)
• The growing number of INTERNET hosts causes a shortage in IP
addresses and will eventually consume the entire address space.
• The theoretical address space size (2^32 nodes) is largely wasted
due to assignment inefficiencies.
• Dividing the address space into classes (A, B and C) had its own
contribution to the inefficiency of addresses assignment.
• Changing the IP addressing scheme is a matter concerning all
INTERNET users and is an opportunity for providing additional
functionality to the IP.
• The new version of IP is often referred to as IPng:
"INTERNET Protocol the Next Generation".
This new address structure should be large enough to meet the
needs of the INTERNET community for a very long time.
IP - The Next Generation (IPng - IPv6)
 There were several proposals for Ipng. The guidelines for
choosing one proposals over the others were based on :
 Current address assignment policies should not be changed.
 There is no need to reclaim assigned network numbers
 There is no need to renumber most of the INTERNET

 IPng offers a larger address space for the INTERNET users.


 The IP address size will be increased from 32 bits to 128 bits.
 This change will allow a much bigger number of nodes than is
available today, with more levels of addressing hierarchy, and
simpler auto-configuration of addresses.
 An address size of 128 bits is large enough to support a huge
number of nodes even with the inefficiency of address
assignment.
IPv6 addressing: IP header

• The IP header will be changed.


• Some fields will be removed in order to keep the overhead
low (in spite of increasing the number of address bits).
• Thus, even though the IPv6 addresses are four times longer
than the IPv4 addresses, the IPv6 header is only twice the
size of the IPv4 header.
• A new function in IPv6 is source routing, which together
with Cluster addresses will allow nodes to control their
routing in a more precise way.
Upgrading IPv4 to IPng - IPv6
• The transition from IPv4 to IPv6 will be simple and
flexible.
• The upgrade will be Incremental: existing IPv4 hosts
and routers may be upgraded to IPv6 and new hosts
and routers can be installed independently.
• The start-up costs are low and little work is needed to
upgrade existing systems to IPv6.
Public and Private address
Although most IPV4 host address are public addresses designed for use in
networks that are accessible on the internet there are blocks of
addresses that are used in networks that require limited or no internet
access.
• Public addresses are designed for use in networks that are accessible on
the internet .
• Private addresses are block of address that require limited or no internet
access.
Private addresses
10.0.0.0 to 10.255.255.255 (10.0.0.0/8)
172.16.0.0 to 172.31.255.255(172.16.0.0/12)
192.168.0.0 to 192.168.255.255(192.168.0.0/16)
 Hosts that do not require access to the internet at large may
make unrestricted use of private addresses .
Public and Private address (cont’)
• Any organization can use these network numbers .
However, no organization is allowed to advertise these
networks using a routing protocol on the internet.
Network Address Translation(NAT)
It translates Private addresses to public addresses. Hosts
on a privately addressed network can have access to
resources across the internet . These services called
network address Translation (NAT) can be implemented
on a device at the edge of the private networks
(router). NAT allows the hosts in the network to
“borrow “ a public address for communicating to
outside networks.
Public and Private address (cont’)
 Public Addresses
• The vast majority of the addresses in the IPV4 unicast host range are
public addresses. These addresses are designed to be used in the hosts
that are publicly accessible from the internet even within these addresses
blocks ,there are many addresses that are designed for other special
purposes.
 Default route(0.0.0.0). When there is no specific route
 Loop back (127.0.0.1). It creates route for TCP/IP applications and services
that run on the same devices to communicate with on another. Addresses
127.0.0.1 to 127.255.255.255 are reserved because they loop back within
the local host.
 Link –Local Addresses: 169.254.0.0 to 169.254.255.255 (169.254.0.0 /16)
are designated as link local Address. The addresses can be automatically
assigned to the local host by the operating system in environment where
no IP configuration is available . These addresses do not provide services
outside of the local networks .
Address Planning
 The allocation of network layer address space within the corporate
network needs to be planned and documented for the purpose of
 Preventing duplication of address
 Providing and controlling access
 Monitoring security and performance.
 Static and dynamic addressing
 Static address are useful for printers, servers and other networking
devices that need to be accessible to clients on the network. It
helps to control network resources.
 Addresses are assigned dynamically by DHCP(Dynamic Host
Configuration Protocol) . It is easy for management of addresses.
 Example: Plan a network to accommodate 800 hosts of the
company.
Address Planning (cont’)
• Network diagram
30
hosts 172.16.3.64/26
172.16.0.0/23 MF Offices
HQ offices
500 20
hosts hosts

172.16.3.128/27
172.16.3.0/26
Legal office
HR Offices 200
50
hosts
hosts 172.16.2.0/24
Sales office

• Fig. Planned Large network company


Popular routing protocols

TCP/IP Protocol Suite 33


DISTANCE VECTOR ROUTING
In distance vector routing, the least cost route between any two nodes is
the route with minimum distance. In this protocol each node maintains a
vector (table) of minimum distances to every node

TCP/IP Protocol Suite 34


Distance vector routing tables

TCP/IP Protocol Suite 35


Initialization of tables in distance vector routing

In distance vector routing, each node shares its table with


its immediate neighbor periodically (eg every 30s) and when
there is a change.

TCP/IP Protocol Suite 36


Updating in distance vector routing

Step 1: Add cost (2) to table received from neighbor (C).


Step 2: Compare Modified Table with Old Table (row by row).
If Next node entry is different, select the row with the smaller
cost. If tie, keep the old one.
If Next node entry the same, select the new row value (regard-
less of whether new value is smaller or not).

TCP/IP Protocol Suite 37


RIP
The Routing Information Protocol (RIP) is an intradomain routing
protocol used inside an autonomous system. It is a very simple protocol
based on distance vector routing.

The topics discussed in this section include:

RIP Message Format


Requests and Responses
Timers in RIP
RIP Version 2
Encapsulation

TCP/IP Protocol Suite 38


Example of a domain using RIP

Note the
metric used
here for Cost
is simply the
hop count.

TCP/IP Protocol Suite 39


LINK STATE ROUTING
In link state routing, if each node in the domain has the entire
topology of the domain, the node can use Dijkstra’s algorithm to
build a routing table

Each router knows (maintains) its states of its links.


Each router floods this info (via a Link State Packet) to other
routers periodically (when there is a change in the topology,
or every 60 to 120 minutes).Each router takes in this data and, using Dijkstra’s
algorithm, creates the shortest path tree and corresponding routing table.

TCP/IP Protocol Suite 40


Dijkstra algorithm

TCP/IP Protocol Suite 41


Example of formation of shortest path tree

TCP/IP Protocol Suite 42


Routing table for node A

Now let’s try using the Dijkstra’s algorithm introduced in


TDC 361.

TCP/IP Protocol Suite 43


TCP/IP Protocol Suite 44

You might also like