Sunteți pe pagina 1din 43

IP Addressing

Computer Identifiers


Computers on the Internet are referred to as hosts. Each host as at least three identifiers:
Internet name (Host Name) for humans to use (i.e. garfield.ncat.edu) Internet address,(Logical Name) a 32 bit binary number written in decimal as four bytes (i.e.152.8.240.16) hardware address,(MAC Address) such as an Ethernet address (i.e. 00-e0-63-03-76-c0 for garfield)

MAC Addresses
Each adapter on LAN has unique LAN address

1A-2F-BB-76-09-AD

Broadcast address = FF-FF-FF-FF-FF-FF

LAN (wired or wireless)


71-65-F7-2B-08-53 58-23-D7-FA-20-B0

= adapter

0C-C4-11-6F-E3-98

LAN Address


MAC address allocation administered by IEEE manufacturer buys portion of MAC address space MAC flat address portability
can move LAN card from one LAN to another contrast with IP addresses?

Internet Names


Hierarchical starting from the right host.subnet.organization.type Rightmost identifies the type or organization or country
edu, com, mil, org, net us, ca, de, uk

IP Addresses


 

To be able to identify a host on the internet, each host is assigned an address, the IP address, or Internet Address. The standards for IP addresses are described in RFC 1166 -- Internet Numbers. When the host is attached to more than one network, it is called multi-homed and it has one IP address for each network interface. An IP Address is a 32 bit binary number. IP addresses are used by the IP protocol to uniquely identify a host on the internet.

The Dotted Decimal Notation


 

IP addresses are usually represented in a dotted decimal form). IP address is made of four groups of decimal numbers between 0 - 255 separated by dots. Some of the numbers are special (like 0.0.0.0 or 255.255.255.255) and are used to designate the default gateway, a broadcast or multicast address, or some reserved numbers for the developers to play with

Parts of an IP Address


A part of the address designates the network numbers, and the remaining part designates the host number. So, we may say an IP address has the format NETWORK.HOST. The network number part of the IP address is centrally administered by the Internet Network Information Centre (the InterNIC) and is unique throughout the Internet. The IP address consists of a pair of numbers: IP address = <network number><host number>

IPv4 Addressing


IP address: 32-bit identifier for host, router interface interface: connection between host/router and physical link
routers typically have multiple interfaces host may have multiple interfaces IP addresses associated with each interface

223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.2.9 223.1.2.2

223.1.3.27

223.1.3.1

223.1.3.2

223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1


9

IP Address Classes


Traditionally, the conventions are that there are three main types of IP networks. Class A Class B Class C There are also: Class D Class E
10

     

Assigned Classes of Internet Addresses




The first bits of the IP address specify how the rest of the address should be separated into its network and host part. The terms network address and netID are sometimes used instead of network number, but the formal term, used in RFC 1166, is network number. Similarly, the terms host address and hostID are sometimes used instead of host number.
11

Address Ranges and Extended Network Prefix




Class A addresses use 7 bits for the network number giving 126 possible networks (out of every group of network and host numbers, two have a special meaning). The remaining 24 bits are used for the host number, so each networks can have up to 224 - minus 2 (16,777,214) hosts. Class B addresses use 14 bits for the network number, and 16 bits for the host number giving 16,382 Class B networks each with a maximum of 65534 hosts. Class C only 254 hosts (all 0 and 1 combinations are not allowed). 21 bits for the network number and 8 for the host number giving 2,097,150 networks each with up to 254 hosts.

12

Other Address Classes




There is also a Class D address (starts with 1110) used for multicasting, which is used to address groups of hosts in a limited area. Class E addresses are reserved for future use. Class E (1111) addresses are reserved for the nerds.

13

IP Address Space Shortage




It is clear that a class A address will only be assigned to networks with a huge number of hosts, and that class C addresses are suitable for networks with a small number of hosts. However, this means that medium-sized networks (those with more than 254 hosts or where there is an expectation that there may be more than 254 hosts in the future) must use Class B addresses. The number of small- to medium-sized networks has been growing very rapidly in the last few years and it was feared that, if this growth had been allowed to continue unabated, all of the available Class B network addresses would have been used by the mid1990s. This is termed the IP Address Exhaustion problem. The problem and how it is being addressed are discussed in The IP Address Exhaustion Problem.
14

IPv4 - Problems


The decision to standardize on a 32 bit address space meant that there were only 232 (4,294,967,296) IPv4 addresses available. During the early days of the Internet, the seemingly unlimited address space allowed IP addresses to be allocated based on requests rather than its actual need. The class A, B, and C octet boundaries were easy to understand and implement, but they did not foster efficient allocation of addresses.
15

IPv4 - Problems
  

Class C, which supports 254 hosts, is too small. Class B, which supports 65534 hosts is too large. In the past, sites with several hundred hosts have been assigned as single Class B address rather than couple of Class C addresses. Unfortunately, this has resulted in a premature depletion of the Class B network address space.

16

Private Internets


Another approach to conservation of the IP address space is described in RFC 1597 - Address Allocation for Private Internets.
Briefly, it relaxes the rule that IP addresses are globally unique by reserving part of the address space for networks which are used exclusively within a single organization and which do not require IP connectivity to the Internet. There are three ranges of addresses which have been reserved by IANA for this purpose:

y y y

10.0.0.0 A single Class A network 172.16 through 172.31 16 contiguous Class B networks 192.168.0 through 192.168.255 256 contiguous Class C networks
17

Private Internets


Any organization may use any addresses in these ranges without reference to any other organization. However
because these addresses are not globally unique, they cannot be referenced by hosts in another organization and they are not defined to any external routers.

Routers in networks not using private addresses, particularly those operated by Internet service providers, are expected to quietly discard all routing information regarding these addresses. Routers in an organization using private addresses are expected to limit all references to private addresses to internal links; they should neither advertise routes to private addresses to external routers nor forward IP datagrams containing private addresses to via external routers.
18

Subnetting


Subnetting Why?
Internet routing tables were beginning to grow. Local administrators had to request another network number from the Internet before a new network could be installed at their site.

In 1985, RFC 950 defined a standard procedure to support the subnetting, or division, of a single Class A, B, or C network number into smaller pieces.

19

Subnets


IP address:
subnet part (high order bits) host part (low order bits)

223.1.1.1 223.1.2.1 223.1.1.2 223.1.1.4 223.1.1.3 223.1.2.9 223.1.2.2

223.1.3.27

Whats a subnet ?
device interfaces with same subnet part of IP address can physically reach each other without intervening router
223.1.3.1

LAN
223.1.3.2

network consisting of 3 subnets

20

Subnets
How many?
223.1.1.1

223.1.1.2

223.1.1.4 223.1.1.3

223.1.9.2

223.1.7.0

223.1.9.1 223.1.8.1 223.1.2.6 223.1.2.1 223.1.2.2 223.1.3.1 223.1.8.0

223.1.7.1

223.1.3.27 223.1.3.2

21

Subnets and Subnet Masks




  

 

Allow arbitrary complexity of internetworked LANs within organization Insulate overall internet from growth of network numbers and routing complexity Site looks to rest of internet like single network Each LAN assigned subnet number Host portion of address partitioned into subnet number and host number Local routers route within subnetted network Subnet mask indicates which bits are subnet number and which are host number

22

Subnet Mask Calculation


Binary Representation IP address Subnet mask Bitwise AND of address and mask (resultant network/subnet number) Subnet number Host number 11000000.11100100.00010001.00111001 11111111.11111111.11111111.11100000 11000000.11100100.00010001.00100000 Dotted Decimal 192.228.17.57 255.255.255.224 192.228.17.32

11000000.11100100.00010001.001 00000000.00000000.00000000.00011001

1 25

23

Routing Using Subnets

24

Extended-Network-Prefix


Internet routers use only the network-prefix of the destination address to route traffic to a subnetted environment. Routers within the subnetted environment use the extended networkprefix to route traffic between the individual subnets. The extended-network prefix is composed of the classful network-prefix and the subnet-number. The extended-network-prefix has traditionally been identified by the subnet mask.

25

Extended-Network-Prefix and Subnet Mask




if you have the /16 address of 130.5.0.0 and you want to use the entire third octet to represent the subnet-number, you need to specify a subnet mask of 255.255.255.0. The bits in the subnet mask and the Internet address have a oneto-one correspondence.
The bits of the subnet mask are set to 1 if the system examining the address should treat the corresponding bit in the IP address as part of the extended-network-prefix. The bits in the mask are set to 0 if the system should treat the bit as part of the host-number.

26

Subnet Design Considerations




The deployment of an addressing plan requires careful thought on the part of the network administrator. There are four key questions that must be answered before any design should be undertaken:
1. 2. 3.

4.

How many total subnets does the organization need today? How many total subnets will the organization need in the future? How many hosts are there on the organization's largest subnet today? How many hosts will there be on the organization's largest subnet in the future?

27

Extended-Network-Prefix and Subnet Mask




The standards describing modern routing protocols often refer to the extended-networkprefix-length rather than the subnet mask. The prefix length is equal to the number of contiguous one-bits in the traditional subnet mask. This means that specifying the network address 130.5.5.25 with a subnet mask of 255.255.255.0 can also be expressed as 130.5.5.25/24.

28

Subnet Example #1

29

Subnet Example #1

30

Defining Host Addresses for Each Subnet




According to Internet practices, the host-number field of an IP address cannot contain all 0-bits or all 1-bits. The all-0s host-number identifies the base network (or subnetwork) number, while the all-1s host-number represents the broadcast address for the network (or subnetwork).

31

Defining the Broadcast Address for Each Subnet


This is always the case - the broadcast address for Subnet #n is one less than the base address for Subnet #(n+1).

32

IP Configuration Parameters


IP Address
Identifies the computer/host Either assigned/configured statically by the administrator or May be assigned dynamically through DHCP

Subnet Mask
32 bit integer, like the IP address Indicates the size of the subnet Used to generate Network Address IP address and Subnet Mask are logically ANDed to produce the Network ID of the source and detination

Default Gateway
The Way Out of the Subnet Router
33

IP Configuration Parameters


DNS Server
On the Internet, the domain name system (DNS) stores and associates many types of information with domain names; most importantly, it translates domain names (computer hostnames) to IP addresses.

34

How IP Operates at a Host

35

NAT: Network Address Translation


rest of Internet local network (e.g., home network) 10.0.0/24
10.0.0.4 138.76.29.7 10.0.0.3

10.0.0.1

10.0.0.2

All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers

Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual)

36

Figure 19.10 A NAT implementation

37

Figure 19.12 NAT address translation

38

Figure 19.13 An ISP and NAT

39

ARP: Address Resolution Protocol


Question: how to determine MAC address of B knowing Bs IP address?
237.196.7.78 1A-2F-BB-76-09-AD 237.196.7.23 237.196.7.14

Each IP node (Host, Router) on LAN has ARP table ARP Table: IP/MAC address mappings for some LAN nodes
< IP address; MAC address; TTL>

LAN
71-65-F7-2B-08-53 58-23-D7-FA-20-B0

0C-C4-11-6F-E3-98 237.196.7.88

TTL (Time To Live): time after which address mapping will be forgotten (typically 20 min)
40

ARP protocol: Same LAN (network)




A wants to send datagram to B, and Bs MAC address not in As ARP table. A broadcasts ARP query packet, containing B's IP address Dest MAC address = FF-FF-FF-FF-FF-FF all machines on LAN receive ARP query B receives ARP packet, replies to A with its (B's) MAC address
frame sent to As MAC address (unicast)

A caches (saves) IP-toMAC address pair in its ARP table until information becomes old (times out)

ARP is a soft state protocol: information that times out unless refreshed ARP is plug-and-play:
nodes create their ARP tables without intervention from net administrator

41

Routing to another LAN


send datagram from A to B via R assume A knows B IP address

Two ARP tables in router R, one for each IP network (LAN)

42

  

  

 

A creates datagram with source A, destination B A uses ARP to get Rs MAC address for 111.111.111.110 A creates link-layer frame with R's MAC address as dest, frame contains A-to-B IP datagram As adapter sends frame Rs adapter receives frame R removes IP datagram from Ethernet frame, sees its destined to B R uses ARP to get Bs MAC address R creates frame containing A-to-B IP datagram sends to B

B
43

S-ar putea să vă placă și