0% found this document useful (0 votes)
12 views32 pages

Internet Addressing

The document discusses Internet Addressing, emphasizing the importance of IP addresses, gateway addresses, and subnet masks for data delivery in networks. It covers various addressing schemes (Class A, B, C, D, E) and explains subnetting, including the use of subnet masks to manage TCP/IP networks. Additionally, it introduces common Unix network tools like ifconfig, ping, and traceroute for network configuration and diagnostics.

Uploaded by

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

Internet Addressing

The document discusses Internet Addressing, emphasizing the importance of IP addresses, gateway addresses, and subnet masks for data delivery in networks. It covers various addressing schemes (Class A, B, C, D, E) and explains subnetting, including the use of subnet masks to manage TCP/IP networks. Additionally, it introduces common Unix network tools like ifconfig, ping, and traceroute for network configuration and diagnostics.

Uploaded by

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

Internet Addressing

The following slides were part of a


presentation on networking concepts, in
particular on Internet Addressing. We
will go through *some* of these slides
during the lab session; the topics
covered should help you with this
week’s Lab Tasks.

1
In order for a host machine to be able to
deliver data through the Internet, it must
be configured with an IP address,
gateway address and subnet mask.

Consider the analogy with the delivery of


real-life mails, where each mail need to
have a unique physical address, &
grouped by things like country, state,
suburbs, & area codes. And a postman
delivers the actual mails.
2
IP Addressing

One issue that must be addressed is the


problem of identifying an individual node
in a network.
This is handled with an addressing
scheme called IP (or internet) addressing,
where the node is allocated a unique
32-bit internet address indicating the
machine's organisation/node address.
(e.g. 130.194.224.160, or 10000010.11000010.11100000.10100000)
- shown here in dot-decimal format, and its equivalent binary format
3
Digression : Binary-to-Decimal Translation

2n 2n-1 .... 27 26 25 24 23 22 21 20

20 = 1, 21 = 2, 22 = 4, 23 = 8, etc

Eg. 10100000 = 1x27 + 0x26 + 1x25 + 0x24 + 0x23


(binary) + 0x22 + 0x21 + 0x20
= 128 + 32
= 160 (decimal)
Hence,

10000010.11000010.11100000.10100000 = 130.194.224.160
4
Addressing Schemes :
Class A – Large networks
Normal
Class B – Medium networks classes

Class C – Small networks

Class D – Multicast Special


classes

Class E – Reserved
5
Class A/B/C Summary :
32-bits

w . x . y . z

Class Value for w NetID HostID Max # of Max # of


Portion Portion NetIDs HostIDs
(in decimal)
available available
A 1-126 w x.y.z 128 16,777,214
B 128-191 w.x y.z 16,384 65,534
C 192-223 w.x.y z 2,097,152 254

Note : an IP address hence has at least 2 parts : a NetID part, & a HostID part
(analogy : a telephone number has an AreaCode part and a LocalNumber part)
6
Note : Fixed Leading Bits (0 for Class A, 10 for Class B, 110 for Class C, etc)

1111

Note how the IPs in the normal classes have a dividing point separating the
NetID & the HostID. Also note the fixed leading bits for the different classes.
7
Addressing Ranges :
Class A :
1.xxx.xxx.xxx to 126.xxx.xxx.xxx

Class B :
128.0.xxx.xxx to 191.255.xxx.xxx

Class C :
192.0.0.xxx to 223.255.255.xxx
8
9
Side note – are we running out of IP
addresses?

-the current IPv4 addressing scheme is


32-bit, & can support 232 (4,294,967,296)
IP addresses – almost all used up (as of
2011)!!

-the newer IPv6 uses 128-bit addresses,


& so supports 2128 (approx. 340
undecillion, or 3.4×1038) IP addresses
10
Subnetworks and Subnetwork Masks

Subnetworks have been useful tools


for the management of TCP/IP
networks.

Groups of (commonly)
geographically located nodes are
placed into a common subnetwork.

11
eg. Consider the IP address
130.194.224.7 :

The group of nodes that are related


in some way are known as the 224
“subnet” (as all traffic will come to
their part of the network based upon
the class B network address
component – 130.194).

12
When subnets are in use, one
problem that may arise is – “What is
the real local HostID?” (i.e., what is
directly connected to this node)
In order for subnetting to work, a
subnet “mask” is implemented on all
nodes and routers. This is used to
determine the real Host ID for any
particular IP address.

13
• with subnetting, an IP address is
now made up of 3 components :
NetworkID, SubnetID, & HostID.

• the NetworkID is still external and


visible to the outside world, while the
SubnetID & the HostID are internal
to the organization which owns the
IP address.

14
Administrators may alter the
subnetwork mask to deal with
specific problems.
e.g., rather than allocate the entire
range of the HostIDs to individual
hosts, he may decide to create
“subnets” of devices (perhaps based
on departments or locations), then
use a subnet mask to distinguish
between them.
15
Digression: What is a mask?

A term that is often used in


computing to describe a “filtering” of
data bits – typically using what is
known as a “bit-pattern”.

If using IP version 4, addresses are


32 bits in length. Therefore the mask
is 32 bits in length as well.
16
When a particular address is being
referenced, the mask is applied to
determine its final value.

There are default masks for different


network classes:
Eg. Class C networks often use a mask of
255.255.255.0 (ie. 11111111 11111111 11111111 00000000).
This means that only the last 8-bits of the
address identifies locally connected
machines (“hosts”). 17
IP with Subnets
An IP can now be viewed as consisting of 3
parts : NetworkID, SubnetID, & HostID

Eg. Consider a Class-B network, & using 5 bits


for the subnet IDs; its IP would look like :

NetworkID SubnetID HostID


(16-bit) (5-bit) (11-bit) 18
Using Subnet masks
• a subnet mask has exactly the same
number of bits as the IP address it is
supposed to operate on (ie. 32-bit for
IPv4). It has 1’s in the NetworkID &
SubnetID positions, and 0’s in the HostID
positions.
a typical subnet mask

Eg. 11111111 11111111 11111000 00000000

all 1’s on the left all 0’s on the right


(NetID + SubnetID) (HostID) 19
Using Subnet masks
• the mask is used by applying the
boolean AND operation between it and
the IP address.

Boolean AND Logic :


Bits 0 1
0 0 0
1 0 1

20
Using Subnet masks

• the end result is : the NetworkID &


SubnetID bits remain intact, while the
HostID bits are cleared. Since the device
dealing with this IP address already
knows the class of the network (ie. how
many bits are used for the NetworkID), it
can now easily determine the subnet the
address is on.

21
Example : Determining the Subnet
Mask of a Subnetted Network

Eg.

Binary Subnet Mask

Decimal Subnet Mask

Figure taken from “The TCP/IP Guide” 11111000 = 248


(http://www.tcpipguide.com/free/index.htm)

22
Determining the Subnet ID of an IP
Address Through Subnet Masking
In this example, let’s consider a host on this network with
a real IP address of 154.71.150.42 :

Figure taken from “The TCP/IP Guide” This gives us the


subnetID of 10010 23
(http://www.tcpipguide.com/free/index.htm) (or 18 in decimal)
Determining the Subnet & Host IDs of an
IP Address Through Subnet Masking
ie. The actual Host ID is :
Network ID Subnet ID Host ID 11000101010 (or 1578 in decimal)

Figure taken from “The TCP/IP Guide”


(http://www.tcpipguide.com/free/index.htm) 24
Subnet Mask

It is most often used to determine


what is local to a host or which
interface to use to deliver packets for
a router.

Eg. in the previous example, the


packets will be delivered to Network
154.71, Subnet 18, and Host 1578.
25
Some common Unix network tools

ifconfig
ping
ethtool
netstat
traceroute

26
ifconfig
This tool changes the configuration of
interfaces.

Usage :

ifconfig (with no argument)


(displays the current configuration)

Or, with the new values:.


sudo ifconfig eth0 192.168.3.100 netmask 255.255.255.0 up
(reconfigures the ethernet NIC with a new fixed address )
27
ping (Packet Internet Groper)

A tool to detect the existence of


a device within the Internet
and/or connectivity to that
device.

Example usage:
ping 130.194.1.99

28
ethtool
Permits configuration of the
ethernet interface(s).

Example usage:

ethtool eth0
(displays the current hardware configuration)
ethtool –s eth0 speed 10
(alters the current interface speed to 10Mbps)

29
netstat
A tool for displaying the current
network statistics, particularly
the external network connections.

Example usage:
netstat –a
(show all internet sockets – try this command while you have
some internet browsing sessions opened)

30
traceroute
A tool for following the path taken
in the Internet by packets from
source host to destination address.

Example usage:
traceroute 130.194.1.99

31
Some useful web references
http://www.tcpipguide.com/free/index.htm
http://www.computerhope.com/jargon/i/ip.htm
http://www.webopedia.com/TERM/S/subnet_mask.html
http://www.freesoft.org/CIE/Topics/26.htm
http://www.tech-faq.com/ip-address-classes.shtml
http://download.microsoft.com/download/9/4/6/946958ef-7b86-4ddc-bfdb-
c7ed2af4ce51/TCPIP_Fund.pdf
http://acc6.its.brooklyn.cuny.edu/~gurwitz/core5/nav2tool.html
http://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html

32

You might also like