Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

ECCI 2105 4/26/2021

IPv4 Addressing: Introduction


223.1.1.1

• IP address: 32-bit 223.1.2.1


223.1.1.2
identifier for host, 223.1.1.4 223.1.2.9

IPv4 Addressing router interface


• Interface: connection
223.1.1.3 223.1.3.27
223.1.2.2

between host/router
and physical link 223.1.3.1 223.1.3.2
– router’s typically have
multiple interfaces
– IP addresses associated with
each interface 223.1.1.1 = 11011111 00000001 00000001 00000001

223 1 1 1

1 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

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

5 6

1
ECCI 2105 4/26/2021

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

7 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 of the first octet which is always a 0, is address 127 is a special purpose address, 126
used to indicate the address as a Class A address & Class A Networks are available.
the remaining 7 bits are used to designate the
Network.
• The other 3 octets contain the Host address.

9 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

11 12

2
ECCI 2105 4/26/2021

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.

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

15 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
17
the default route. 18

3
ECCI 2105 4/26/2021

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.

19 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 and host part of the
address.

21 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.9.2 223.1.7.0
– host part (low order bits) 223.1.1.3 223.1.3.27
223.1.2.2

• What’s a subnet ? LAN


– device interfaces with
223.1.9.1
same subnet/network 223.1.3.1 223.1.3.2
223.1.8.1 223.1.8.0
223.1.7.1

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

23 24

4
ECCI 2105 4/26/2021

Features of CIDR
• Elimination of classful addressing

Classless Interdomain • Classless Addressing

Routing (CIDR)

25 26

IP addressing: CIDR IP addresses: how to get one?


• CIDR: Classless InterDomain Routing • Q: How does a host get IP address?
– subnet portion of address can of be arbitrary • Two options:
length – Given/hard-coded by system admin
– address format: a.b.c.d/x, where x is # bits in – DHCP: Dynamic Host Configuration Protocol:
subnet portion of address dynamically get address from as server
• “plug-and-play”
subnet host
part part

11001000 00010111 00010000 00000000


200.23.16.0/23
27 28

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

29 30

5
ECCI 2105 4/26/2021

NAT: Network Address Translation NAT: Network Address Translation


NAT translation table
2: NAT router 1: host 10.0.0.1
rest of local network 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 10.0.0.3
address: 138.76.29.7, have 10.0.0/24 address for 4: NAT router
3: Reply arrives changes datagram
different source port numbers source, destination (as usual) dest. address: dest addr from
138.76.29.7, 5001 138.76.29.7, 5001 to 10.0.0.1, 3345

31 32

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

33 34

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

35 36

You might also like