ECCI 2105 4/3/2017
IPv4 Addressing: introduction
223.1.1.1
• IP address: 32-bit 223.1.2.1
identifier for host, router 223.1.1.2
IPv4 Addressing & interface
223.1.1.4 223.1.2.9
• Interface: connection 223.1.3.27
223.1.2.2
Subnetting
223.1.1.3
between host/router and
physical link
– router’s typically have 223.1.3.1 223.1.3.2
multiple interfaces
– host may also have
multiple interfaces
– IP addresses associated 223.1.1.1 = 11011111 00000001 00000001 00000001
with each interface
223 1 1 1
ECCI 2105 1 ECCI 2105 2
Octets IP Address Classes
• An IP address is made up of 4 bytes • IP addresses are divided into 5 classes, each of
• The 32-bit IP address is broken up into 4 which is designated with the alphabetic letters
octets, which are arranged into a dotted- A to E.
decimal notation scheme. • Class D addresses are used for multicasting.
• An octet is a set of 8 bits • Class E addresses are reserved for testing
• Example of an IP version 4:
172.64.126.52
ECCI 2105 3 ECCI 2105 4
IP Address Classes (Cont.) IP Address Classes (Cont.)
• Using the ranges, you can determine the class of an
• The 5 IP classes are split up based on the address from its 1st octet value.
value in the 1st octet: • An address beginning with 120 is a Class A address,
155 is a Class B address & 220 is a Class C address.
ECCI 2105 5 ECCI 2105 6
1
ECCI 2105 4/3/2017
Are You the Host or the Network?
Are You the Host or the Network?
(Cont.)
• Each network is assigned a network address &
• The 32 bits of the IP address are divided into every device or interface (such as a router port)
Network & Host portions, with the octets on the network is assigned a host address.
assigned as a part of one or the other.
• There are only 2 specific rules that govern the
Network & Host Representation value of the address.
By IP Address Class
Class Octet1 Octet2 Octet3 Octet4 – A host address cannot be designated by all zeros or all
Class A Network Host Host Host
ones.
– These are special addresses that are reserved for
Class B Network Network Host Host
special purposes.
Class C Network Network Network Host
ECCI 2105 7 ECCI 2105 8
Class A Addresses Class A Addresses (Cont.)
• Class A IP addresses use the 1st 8 bits (1st Octet) to • There are 128 Class A Network Addresses, but
designate the Network address. because addresses with all zeros aren’t used &
• The 1st bit which is always a 0, is used to indicate the address 127 is a special purpose address, 126
address as a Class A address & the remaining 7 bits Class A Networks are available.
are used to designate the Network.
• The other 3 octets contain the Host address.
ECCI 2105 9 ECCI 2105 10
Class A Addresses (Cont.) Class A Addresses (Cont.)
• There are 16,777,214 Host addresses available in a • For a Class A network, there are:
Class A address. 224 – 2 or 16,777,214 hosts.
• Rather than remembering this number exactly, you • You can use the same formula to determine the
can use the following formula to compute the number of Networks in an address class.
number of hosts available in any of the class • Eg., a Class A address uses 7 bits to designate the
addresses, where “n” represents the number of bits network, so (27 – 2) = 126 or there can be 126 Class
in the host portion: A Networks.
(2n – 2) = Number of available hosts
ECCI 2105 11 ECCI 2105 12
2
ECCI 2105 4/3/2017
Class B IP Addresses Class B IP Addresses (Cont.)
• Class B addresses use the 1st 16 bits (two octets) for • So how many Class B Networks can there be?
the Network address.
• Using our formula, (214 – 2), there can be
• The last 2 octets are used for the Host address.
16,382 Class B Networks & each Network can
• The 1st 2 bit, which are always 10, designate the have (216 – 2) Hosts, or 65,534 Hosts.
address as a Class B address & 14 bits are used to
designate the Network. This leaves 16 bits (two
octets) to designate the Hosts.
ECCI 2105 13 ECCI 2105 14
Class C IP Addresses Class C IP Addresses (Cont.)
• Class C addresses use the 1st 24 bits (three
octets) for the Network address & only the
last octet for Host addresses.
• The 1st 3 bits of all class C addresses are set to
110, leaving 21 bits for the Network address,
which means:
– there can be 2,097,150 (221 – 2) Class C Networks,
– but only 254 (28 – 2) Hosts per Network.
ECCI 2105 15 ECCI 2105 16
Special Addresses Special Addresses (Cont.)
• A few addresses are set aside for specific
purposes.
• Network addresses that are all binary zeros, all
binary ones & Network addresses beginning
with 127 are special Network addresses.
Default route:
•In computer networking, the default route is a setting on a computer that
defines the packet forwarding rule to use when no specific route can be
determined for a given Internet Protocol (IP) destination address.
•All packets for destinations not established in the routing table are sent via
ECCI 2105 17
the default route. ECCI 2105 18
3
ECCI 2105 4/3/2017
Special Addresses (Cont.) – Private
Special Addresses (Cont.)
address space
• Within each address class is a set of addresses
that are set aside for use in local networks • A list of these addresses for each IP address
sitting behind a firewall or NAT (Network class that are available for use in a LAN.
Address Translation) device or Networks not • This is the private address space
connected to the Internet.
ECCI 2105 19 ECCI 2105 20
Default Standard Subnet Masks Subnet Mask
• There are default standard subnet masks • An IP address has 2 parts:
for Class A, B and C addresses: – The Network identification.
– The Host identification.
• Frequently, the Network & Host portions of the
address need to be separately extracted.
• In most cases, if you know the address class, it’s easy
to separate the 2 portions.
• The subnet masking process was developed to
identify & extract the Network part of the address.
ECCI 2105 21 ECCI 2105 22
Subnets Subnets 223.1.1.2
223.1.1.1 223.1.1.1 223.1.1.4
• IP address consist of: 223.1.2.1 • How many?
223.1.1.2 223.1.1.3
– Subnet/network part 223.1.1.4 223.1.2.9
(high order bits)
223.1.2.2 223.1.9.2 223.1.7.0
– host part (low order bits) 223.1.1.3 223.1.3.27
• What’s a subnet ? LAN
– device interfaces with
223.1.3.2 223.1.9.1 223.1.7.1
same subnet/network 223.1.3.1
223.1.8.1 223.1.8.0
part of IP address
– can physically reach each 223.1.2.6 223.1.3.27
other without network consisting of 3 subnets
223.1.2.1 223.1.2.2 223.1.3.1 223.1.3.2
intervening router
ECCI 2105 23 ECCI 2105 24
4
ECCI 2105 4/3/2017
Features of CIDR
• Elimination of classful addressing
• Classless Addressing
Classless Interdomain
Routing (CIDR)
ECCI 2105 25 ECCI 2105 26
IP addressing: CIDR Example: Class C Addresses
• CIDR: Classless InterDomain Routing
– subnet portion of address can of be arbitrary
length
– address format: a.b.c.d/x, where x is # bits in
subnet portion of address
subnet host
part part
11001000 00010111 00010000 00000000
200.23.16.0/23
ECCI 2105 27 ECCI 2105 28
Example: Class B Addresses IP addresses: how to get one?
• Q: How does a host get IP address?
• Two options:
– Given/hard-coded by system admin
– DHCP: Dynamic Host Configuration Protocol:
dynamically get address from as server
• “plug-and-play”
ECCI 2105 29 ECCI 2105 30
5
ECCI 2105 4/3/2017
IP addresses: how to get one? IP addressing: the last word...
• Q: How does network get subnet part of IP • Q: How does an ISP get block of addresses?
addr? • A: ICANN: Internet Corporation for Assigned
• A: gets allocated portion of its provider ISP’s Names and Numbers:
address space
ISP's block 11001000 00010111 00010000 00000000 200.23.16.0/20 – allocates addresses
Organization 0 11001000 00010111 00010000 00000000 200.23.16.0/23 – manages DNS (Domain Name System). DNS –
Organization 1 11001000 00010111 00010010 00000000 200.23.18.0/23 Converts web address to IP address.
Organization 2 11001000 00010111 00010100 00000000 200.23.20.0/23
... ….. …. …. – assigns domain names, resolves disputes
Organization 7 11001000 00010111 00011110 00000000 200.23.30.0/23
ECCI 2105 31 ECCI 2105 32
NAT: Network Address Translation NAT: Network Address Translation
NAT translation table 1: host 10.0.0.1
rest of local network 2: NAT router WAN side addr LAN side addr
changes datagram sends datagram to
Internet (e.g., home network) 138.76.29.7, 5001 10.0.0.1, 3345
10.0.0.1 source addr from 128.119.40, 80
10.0.0/24 …… ……
10.0.0.1, 3345 to
10.0.0.4 138.76.29.7, 5001, S: 10.0.0.1, 3345
10.0.0.2 updates table D: 128.119.40.186, 80
138.76.29.7 10.0.0.1
1
S: 138.76.29.7, 5001
10.0.0.3 2 D: 128.119.40.186, 80 10.0.0.4
10.0.0.2
All datagrams leaving local Datagrams with source or 138.76.29.7 S: 128.119.40.186, 80
D: 10.0.0.1, 3345
4
network have same single source NAT IP destination in this network S: 128.119.40.186, 80
3
D: 138.76.29.7, 5001
4: NAT router 10.0.0.3
address: 138.76.29.7, have 10.0.0/24 address for 3: Reply arrives
source, destination (as usual) changes datagram
different source port numbers dest. address: dest addr from
138.76.29.7, 5001 138.76.29.7, 5001 to 10.0.0.1, 3345
ECCI 2105 33 ECCI 2105 34
NAT: Network Address Translation NAT: Network Address Translation
• Motivation: local network uses just one IP • Implementation: NAT router must:
address as far as outside word is concerned: – outgoing datagrams: replace (source IP address, port #) of every
– no need to be allocated range of addresses from outgoing datagram to (NAT IP address, new port #)
• . . . remote clients/servers will respond using (NAT IP address, new
ISP: - just one IP address is used for all devices port #) as destination addr.
– can change addresses of devices in local network – remember (in NAT translation table) every (source IP address,
without notifying outside world port #) to (NAT IP address, new port #) translation pair
– can change ISP without changing addresses of – incoming datagrams: replace (NAT IP address, new port #) in
devices in local network dest fields of every incoming datagram with corresponding
(source IP address, port #) stored in NAT table
– devices inside local net not explicitly addressable,
visible by outside world (a security plus).
ECCI 2105 35 ECCI 2105 36
6
ECCI 2105 4/3/2017
ICMP: Internet Control Message
Traceroute
Protocol
• used by hosts & routers to communicate network- • The Traceroute or Trace command is used to show the complete route
from a source to a destination.
level information • Trace sends out probe packets one at a time to each router or switch in
– error reporting: unreachable host or network the path between the source & the destination IP address entered.
– used by ping
• network-layer “above” IP:
– ICMP msgs carried in IP datagrams
ECCI 2105 37 ECCI 2105 38
Introduction
• Internet Protocol version 6, is a new
addressing protocol designed to incorporate
IPv6 whole sort of requirement of future internet
known to us as Internet version 2.
• Along with its offering of enormous amount of
logical address space, this protocol has ample
of features which addresses today’s
shortcoming of IPv4.
ECCI 2105 39 ECCI 2105 40
Why IPv6 Why IPv6
• Given below are major points which played key role in birth of IPv6:
• So far, IPv4 has proven itself as a robust routable a) Internet has grown exponentially and the address space allowed by
IPv4 is saturating. There is a requirement of protocol which can
addressing protocol and has served human being for satisfy the need of future Internet addresses which are expected to
decades on its best-effort-delivery mechanism. grow in an unexpected manner.
b) Using features such as NAT due to the inadequate number of IPv4
• It was designed in early 80’s and did not get any major addresses , has made the Internet discontiguous i.e. one part which
change afterward. belongs to intranet, primarily uses private IP addresses; which has to
go through number of mechanism to reach the other part, the
• At the time of its birth, Internet was limited only to a Internet, which is on public IP addresses.
few Universities for their research and to Department c) IPv4 on its own does not provide any security feature which is
of Defense. vulnerable as data on Internet, which is a public domain, is never
safe. Data has to be encrypted with some other security application
• IPv4 is 32 bits long which offers around 4,294,967,296 before being sent on Internet.
(232) addresses. d) IPv4 enabled clients have be configured manually or they need some
address configuration mechanism. There exists no technique which
• This address space was considered more than enough can configure a device to have globally unique IP address.
that time.
ECCI 2105 41 ECCI 2105 42
7
ECCI 2105 4/3/2017
IPv6 Features IPv6 Features
• Larger Address Space: • End-to-end Connectivity:
– In contrast to IPv4, IPv6 uses 4 times more bits to address a device on the – Every host/device/system now has unique IP address and can traverse through
Internet. the internet without using NAT or other translating components.
– This much of extra bits can provide approximately 3.438 different combinations – After IPv6 is fully implemented, every host can directly reach other host on
of addresses. the Internet, with some limitationsinvolved like Firewall, Organization’s
– This address can accumulate the aggressive requirement of address allotment policies, etc.
for almost everything in this world. • Faster Forwarding/Routing:
• Simplified Header: – Simplified header puts all unnecessary information at the end of the header.
– IPv6’s header has been simplified by moving all unnecessary information and – All information in first part of the header are adequate for a router to take
options (which are present in IPv4 header) to the end of the IPv6 header. routing decision thus making routing decision as quickly as looking at the
– IPv6 header is only twice as bigger than IPv4 (32 bits) providing the fact the mandatory header, unlike IPv4 addresses.
IPv6 (128 bits) address is four times longer.
ECCI 2105 43 ECCI 2105 44
IPv6 Features
• IPSec:
– IPsec has authentication and encryption features, unlike IPv4.
• For more on IPv6, please check this link:
– Initially it was decided for IPv6 to must have IPSec security, making it more secure than https://www.tutorialspoint.com/ipv6/ipv6_address_
IPv4.
• No Broadcast: types.htm
– Though Ethernet/Token Ring are considered as broadcast network because they support
Broadcasting, IPv6 does not have any broadcast support anymore left with it.
– It uses multicast to communicate with multiple hosts.
ECCI 2105 45 ECCI 2105 46