Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS470 Computer Networking Protocols

Similar presentations


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

1 CS470 Computer Networking Protocols
4/26/2017 CS Computer Networking Protocols 6. IP Addressing Huiping Guo Department of Computer Science California State University, Los Angeles

2 Outline IP addresses Subnetting 5. IP addressing CS470_W12

3 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 5. IP addressing CS470_W12

4 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 5. IP addressing CS470_W12

5 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 5. IP addressing CS470_W12

6 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 5. IP addressing CS470_W12

7 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 5. IP addressing CS470_W12

8 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 5. IP addressing CS470_W12

9 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: 5. IP addressing CS470_W12

10 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 5. IP addressing CS470_W12

11 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 5. IP addressing CS470_W12

12 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 5. IP addressing CS470_W12

13 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: 5. IP addressing CS470_W12

14 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 5. IP addressing CS470_W12

15 Subnetting example 5. IP addressing CS470_W12

16 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. 5. IP addressing CS470_W12

17 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 5. IP addressing CS470_W12

18 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) 5. IP addressing CS470_W12

19 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. 5. IP addressing CS470_W12

20 Subnets Recipe To determine the subnets, detach each interface from its router, creating islands of isolated networks. Each isolated network is a subnet. 5. IP addressing CS470_W12

21 Subnets How many subnets? 6! 223.1.2.1 223.1.1.2 223.1.1.1 223.1.1.3
Subnets How many subnets? 6! 5. IP addressing CS470_W12

22 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 5. IP addressing CS470_W12

23 CIDR Example 1 5. IP addressing CS470_W12

24 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) 5. IP addressing CS470_W12

25 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 Limited Broadcast Address Broadcast on the local LAN Entire address is all 1’s, i.e 5. IP addressing CS470_W12

26 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 5. IP addressing CS470_W12

27 Special Address Summary
5. IP addressing CS470_W12

28 Subnetting Subnetting is the division of a single network into smaller subnets. Each subnet functions as if it were an independent network As far as entries in the routing table are concerned All subnets of a given network number use the same network-prefix but different subnet numbers. 5. IP addressing CS470_W12

29 Why are subnets created?
Provides greater organization of large networks. Remember: a Class A network can have up to 16 million hosts. It allows you to have additional networks without applying for more IP addresses. Decreases broadcast traffic by reducing broadcast domain size. Broadcasts are not forwarded out of a subnet. 5. IP addressing CS470_W12

30 How to subnet a network? Borrow bits from the host field of an IP address. All the subnets have the same network prefix Subnets are only visible to routers inside the network Netid subnetid hostid 16 24 31 5. IP addressing CS470_W12

31 Subnet a network: steps
Determine the number of subnets How many bits to be borrowed? For each subnet, determine The network address subnet bits cannot be all on or off at the same time The host address range The broadcast address Determine the number of required host per subnet: One for each host One for each router interface 5. IP addressing CS470_W12

32 Subnetting example 1: You are assigned a network address /23. You want to create 2 subnets. What are the network addresses and broadcast addresses of the 2 subnets? What are the address range in the 2 subnets? 5. IP addressing CS470_W12

33 Subnetting example 1: 11010110 01100001 11111110 0 000 0000 Subnet 1:
23 Subnet bits      Subnet 1: Network address:      /25 Broadcast address:      /25 Address range:      /25      /25 126 IP addresses 5. IP addressing CS470_W12

34 Subnetting example 1: Subnet 2:
Network address:      /25 Broadcast address:      /25 Address range:      /25      /25 126 IP addresses 5. IP addressing CS470_W12

35 Subnetting example 2: You are assigned a network address /23. If you assign 3 bits to the subnets. How many subnets can be created What are the network addresses and broadcast addresses of the subnets? What are the address range of the subnets? 5. IP addressing CS470_W12

36 Subnetting example 2: 23 Subnet bits      The number of subnets: 23-2=6 Subnet 1: Network address:      /26 Broadcast address:      /26 Address range:      /26      /26 26-2=62 IP addresses 5. IP addressing CS470_W12

37 Subnetting example 2: Subnet 2:
Network address:      /26 Broadcast address:      Address range:           26-2=62 IP addresses 5. IP addressing CS470_W12

38 Subnetting example 2: Subnet 3:
Network address:      /26 Broadcast address:      Address range:           26-2=62 IP addresses 5. IP addressing CS470_W12

39 Subnetting example 2: Subnet 4:
Network address:      /26 Broadcast address:      Address range:           26-2=62 IP addresses 5. IP addressing CS470_W12

40 Subnetting example 2: Subnet 5:
Network address:      /26 Broadcast address:      Address range:           26-2=62 IP addresses 5. IP addressing CS470_W12

41 Subnetting example 2: Subnet 6:
Network address:      /26 Broadcast address:      Address range:           26-2=62 IP addresses 5. IP addressing CS470_W12


Download ppt "CS470 Computer Networking Protocols"

Similar presentations


Ads by Google