Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS4470 Computer Networking Protocols

Similar presentations


Presentation on theme: "CS4470 Computer Networking Protocols"— Presentation transcript:

1 CS4470 Computer Networking Protocols
7/31/2018 CS Computer Networking Protocols 9. IP addresses Huiping Guo Department of Computer Science California State University, Los Angeles

2 TCP/IP Addresses Addressing in TCP/IP is specified by the Internet Protocol (IP) Each host is assigned a 32-bit number Called the IP address or Internet address Unique across entire Internet Each IP address is divided into a prefix and a suffix Prefix identifies network to which computer is attached No two networks can be assigned the same network number Suffix identifies computer within that network No two computers on the same network can have the same suffix, but computers on different networks can have the same suffix Address format makes routing efficient 9. IP Addresses CS4470_F17

3 Properties of IP Addresses
Network numbers (prefix) are unique Assignment of network numbers must be coordinated globally to ensure uniqueness Assigned by ICANN: Internet Corporation of Assigned Names and Numbers Host addresses (suffix) may be reused on different networks combination of network number prefix and host address suffix will be unique assignment of host addresses can be managed locally 9. IP Addresses CS4470_F17

4 Designing IP IP designers chose 32-bit addresses
Still 32 bits in IP version 4 used today May cause a problem soon, not a large enough address space! Allocate some bits for prefix, some for suffix Large prefix, small suffix - many networks, few hosts per network Small prefix, large suffix - few networks, many hosts per network Because of variety of technologies, need to allow for both large and small networks 9. IP Addresses CS4470_F17

5 Classful Addressing Designers chose a compromise - multiple address formats that allow both large and small prefixes Each format is called an address class Class of an address is identified by first four bits 9. IP Addresses CS4470_F17

6 Address Classes Class A, B and C are primary classes
Used for ordinary host addressing Owner of a class is assigned a prefix, gets to pick what machines they want in the suffix Classes A and B are all allocated! Class D is used for multicast, a limited form of broadcast Class E is reserved for future use 9. IP Addresses CS4470_F17

7 Compute the Class of an Address
IP needs to separate the destination address into a prefix and suffix when it handles a packet Look at first dotted decimal number, and use this table: Just a little binary number conversion based on first 4 bits 9. IP Addresses CS4470_F17

8 Division of the Address Space
Classing scheme does not yield equal number of networks in each class Class A: First bit must be 0 7 remaining bits identify Class A net 27 (= 128) possible class A nets For the rest: 9. IP Addresses CS4470_F17

9 Classful Addressing Example
Organization with four networks, completely private network Assign Class A,B,C addresses as appropriate for number of hosts on each network 9. IP Addresses CS4470_F17

10 Limitations of the classful addressing scheme
The IP address space is being exhausted All networks had to choose one of the three possible sizes, many addresses were wasted. Ex. A company requests a network address with a block of host address Has to get a class B address addresses are unused 9. IP Addresses CS4470_F17

11 Subnet and Classless Addressing
Mechanisms to overcome the limitations Subnetting and Classless Addressing Take a single IP network number and allocate the IP addresses with that network number to several physical networks, which are referred to as subnets The postfix of the IP address is further divided into two parts: subnet id and host address Each subnet is assigned a subnet number All host in the same subnet share the same subnet number The network number and the subnet number now become the new network prefix 9. IP Addresses CS4470_F17

12 Subnet masks Classless and subnet addressing requires an additional piece of information stored with each address Known as address masks or subnet masks Used to specify the boundary between the network prefix and the host prefix 1 bits mark the network prefix 0 bits mark the host portion Default subnet mask: Class A: Class B: Class C: 9. IP Addresses CS4470_F17

13 Example We want to share a single class B address among several physical networks (subnets) We can use a subnet mask of Top 24 bits are now defined to be the network number Lower 8 bits are the host number Since the top 16 bits identify the network in a class B address, there are 3 parts in the IP address: a network part, a subnet part and a host part 9. IP Addresses CS4470_F17

14 Subnetting example 9. IP Addresses CS4470_F17

15 Subnets and Subnet Masks
Each host is configured with both an IP address and a subnet mask for the subnet to which it’s attached The bitwise AND of the two numbers defines the subnet number of the host and of all other hosts on the same subnet Eg: At H1, AND = How will hosts use the subnet mask? A host: decides whether a destinations address in a packet is local or not When sending to a destination IP address, perform bitwise AND between the destination IP address and its own subnet mask If the result equals the subnet number of the sender, then it knows that the destination host is on the same subnet Otherwise, the packet needs to be sent to a router to be forwarded to another subnet. 9. IP Addresses CS4470_F17

16 Routers and subnets For simple IP, a router has a forwarding table that consists of entries of the form (networkNumber, NextHop) To support subnetting, the table now hold entries of the form Subnet number Subnet mask Next hop Interface 0 Interface 1 Interface 2 9. IP Addresses CS4470_F17

17 Data forwarding algorithm
D = destination IP address For each forwarding table entry(subnetNumber, subnetMask, nextHop) D1 = SubnetMask & D If D1 = subnetNumber, deliver datagram to nextHop (a router or a network) 9. IP Addresses CS4470_F17

18 What’s a subnet ? Another name of physical network
network consisting of 3 subnets subnet Another name of physical network A subnet is a collection of machines that can communicate with each other without the need for routing Every subnet has at least one router/gateway. If it didn’t, then the subnet couldn’t talk to any machines outside of its network. 9. IP Addresses CS4470_F17

19 Subnets Recipe To determine the subnets, detach each interface from its router, creating islands of isolated networks. Each isolated network is a subnet. 9. IP Addresses CS4470_F17

20 Subnets How many subnets? 6! 223.1.2.1 223.1.1.2 223.1.1.1 223.1.1.3
7/31/2018 Subnets How many subnets? 6! 9. IP Addresses CS4470_F17

21 CIDR Notation CIDR = Classless Inter-Domain Routing
Notation for classless addresses Specifies the mask associated with an address Appends a slash to the address with the size of the mask in decimal Examples: /16 says 16 bit prefix, 16 bit suffix (Class B) /28 28 bit prefix, 4 bit suffix 9. IP Addresses CS4470_F17

22 7/31/2018 CIDR Example 1 9. IP Addresses CS4470_F17

23 Reserved Addresses RFC 1597 – Address Allocation for Private networks
The following blocks are reserved for private networks Class A Class B Class C We’ll need a gateway to translate from these addresses to the Internet addresses Network Address Translation We should never see a machine on the Internet with one of these network prefixes (hopefully) 9. IP Addresses CS4470_F17

24 Special IP Addresses Network Address Directed Broadcast Address
The network itself is assigned an address So no host can have all zero’s as its IP address suffix Prefix is the network prefix, suffix is all zero’s Eg /16 Directed Broadcast Address Broadcast message to a network Prefix is the network prefix, suffix is all one’s So no host can have all one’s as its IP address suffix Can be routed Limited Broadcast Address Broadcast on the local LAN Entire address is all 1’s, i.e Won’t be routed 9. IP Addresses CS4470_F17

25 More Special IP Addresses
This Computer Address To obtain an address automatically when booting, we may use IP to communicate… but we don’t have a correct IP address yet Use an address of all zero’s to indicate “this computer” Loopback Address Any address beginning with 127 indicates the local computer E.g most common, but could be Use for testing network applications, no packets leave the computer 9. IP Addresses CS4470_F17

26 Special Address Summary
9. IP Addresses CS4470_F17


Download ppt "CS4470 Computer Networking Protocols"

Similar presentations


Ads by Google