Subnetting and Network Management Omer F. Rana Networks and Data Communications 1
Subnetting Subnetting is an important concept in establishing TCP/IP based networks important in integrating small Local Area Networks (LANs) For instance, the network component of an IP address always describes a single network however, internally with an enterprise or university, there may be many networks IDEA: Divide a single IP network into a number of smaller sub-networks each of which share the same IP network address. Hence, although there is only one network to the outside world and internal routing can account for different networks Alternative: different IP network address to every physical network this is inefficient use of IP network numbers and could complicate routing Using a similar mechanism, we can also sub-divide hosts on a single physical network into logical groupings these are then considered as the subnets (less common) Networks and Data Communications 2
The IP Problem IP address are 32 bit and can support upto 4 billion hosts Historically, Class A, B and C networks were freely allocation whereas only a fraction of addresses in each network are used this lead to a shortage of addresses for new organisations No more Class A and B networks only a few Class C are now left! this is a major problem (remember: a single class B network address allows us to address 65000 host addresses) Solution There are 2: Increase the number of bits in an IP address to more than 32 define a new version of IP (IPv6) Use sub-netting LAN technology (Ethernet, Ring etc) can only support a fixed number of nodes per network (from 30 to 250) Networks and Data Communications 3
hence no real need to support a large number of hosts on a single network
The Routing Problem Local routers only need a few routes restriction of topologies and hosts internally However, backbone routers must cope with routing huge volumes of traffic between thousands of networks resulting in large routing tables Aim: reduce size of routing tables Networks and Data Communications 4
Destination 144.0.0.0 191.106.0.0 220.3.140.0 Route 191.106.4.2 191.106.4.2 191.106.4.40 Network Mask 255.0.0.0 255.255.0.0 255.255.255.0 255.0.0.0 Network Mask Send Packet To 191.106.4.2 AND 14.5.140.52 14.0.0.0 14.0.0.0 191.106.4.2 Destination Routing Table Entry Address For all routes, IP packet destination address is ANDed with the routing table entry netmask, and then compared with the table s destination route Networks and Data Communications 5
Defining Subnetworks Subnetworks defined using netmask netmask is used to specify which part of the IP address is the network address important that all hosts on a network use the same netmask For instance: 255.255.0.0 default for Class-B nets 255.255 network address 255.255.255.0 for Class-C nets Networks and Data Communications 6
133.33.0.0 network 16 bit host address Traditional Class B (255.255.0.0) 1 0 14 bits network 8 extra network bits - the subnet Subnetted Class B 1 0 (255.255.255.0) 133.33.1.0 133.33.2.0 133.33.3.0... 133.33.254.0 Networks and Data Communications 7 8 bit host address
Hence, if 135.33.156.2 is a Class-B IP address, 133.33 is the Network address and 156.2 is the Host address With sub-netting, if 135.33.156.2 is a Class-B IP address, 133.33 is the Network address, 156 is the Subnetwork address and 2 is the Host address However, important to ensure that certain network addresses keep their meaning such as broadcasts hence under normal addressing: 135.33.152.2 - Class B IP address 255.255.0.0 - Class B net mask 135.33 - Network Address 152.2 - Host number 255.255 - Directed Broadcast and with subnetting 135.33.152.2 - Class B IP address 255.255.255.0 - Subnet mask 135.33 - Network address Networks and Data Communications 8
152 - Subnetwork number 255 - Directed Broadcast to subnet 152 255.255 - Directed Broadcast to ALL subnets Hence, subnet masks should not have all bits set to 1s or 0s as these are usually special address (eg broadcast)
Example: Subnetting 137.64.0.0 - Class B address 255.255.0.0 - Default Netmask (gives 65534 hosts, not all 1 s and 0 s) 255.255.128.0 - subnet mask (1 bit, 2 (1) subnets, 32766 hosts) 255.255.192.0 - subnet mask (2 bits, 4 (2) subnets, 16382 hosts) 255.255.224.0 - subnet mask (3 bits, 8 (6) subnets, 8190 hosts) Subnetting can help us support 2, 4, 8, 16, 32... networks. Hence, 2 bits give us 4 networks, only 2 of which are usable. Networks and Data Communications 9
Similarly, 3 bits give us 8 networks, 6 of which are usable etc rule: we always lose the first and last subnet Possible to establish as many subnets as necessary provided enough addresses remain to address hosts on these subnets To implement a subnet Set subnet mask on network interface, to be used for all routes connected via that interface into the organisation. Can use a variety of tools for doing this such as ifconfig Add routing table entries with a separate entry for each subnet address. These routes will point to a single (or more) routers internally Generally, all hosts on one network segment use the same subnet mask otherwise software like RIP can get confused!
Supernetting Enable support for Variable Length Subnet Masks (VLSM) enable us to dynamically determine the size of a netmask Whereas subnetting is addition of more network bits from host bits supernetting is the reverse i.e. shorten the number of bits allocated to the network Used to reduced routing table sizes to replace consecutive bunches of network addresses with a single higher-level address Networks and Data Communications 10
All networks from: 135.32.0.0 to 135.47.0.0 are routed to 135.32.0.0 network address 16 bit host address 1 0 4 bits of the network portion are ignored for routing purposes Supernetted Class B (255.240.0.0) address: 135.32.0.0 Networks and Data Communications 11
IP-oriented Routing Problem Classful addresses can be geographically dispersed implying that route aggregation is very limited (with standard IP) Require blocks of addresses to be grouped together into a single entry in the routing table An IP address is part of a CIDR block, and is said to match the CIDR prefix if the initial N bits of the address and the CIDR prefix are the same. Thus, understanding CIDR requires that IP address be visualized in binary. Networks and Data Communications 12
CIDR CIDR: Classless InterDomain Routing makes use of supernetting and used to support the size of backbone routers More specific routes (with longer netmasks) can be used to override the routing of networks allocated to the wrong geographical area For instance, if an ISP wants to allocate 16 Class C networks to a customer this would normally require 16 separate routes. With supernetting if the networks have consecutive numbering, only 1 route is required Hence, to support this, ideas is to allocate consecutive sets of Class B addresses to given countries facilitates routing between countries (regional aspects taken into account) Networks and Data Communications 13
Variable Length Subnet Masks (VLSM) Consider a Class C network: 201.45.222.0/24 Do an initial subnetting by using one bit for the subnet ID, leaving us 7 bits for the host ID. This gives us two subnets: 201.45.222.0/25 and 201.45.222.128/25. Each of these can have a maximum of 126 hosts. We set aside the first of these for subnet S6 and its 100 hosts. Take the second subnet, 201.45.222.128/25, and subnet it further into two sub-subnets. We do this by taking one bit from the 7 bits left in the host ID. This gives us the sub-subnets 201.45.222.128/26 and 201.45.222.192/26, each of which can have 62 hosts. We set aside the first of these for subnet S5 and its 50 hosts. Take the second sub-subnet, 201.45.222.192/26, and subnet it further into four sub-sub-subnets. We take 2 bits from the 6 that are left in the host ID. This gives us four sub-sub-subnets that each can have a maximum of 14 hosts. These are used for S1, S2, S3 and S4. Networks and Data Communications 14
See: http://www.tcpipguide.com/free/t IPVariableLengthSubnetMaskingVLSM-3.htm. See also Wikipedia page.
But, this involves Politics! CIDR requires network address assignment based on geographical basis IANA (Internet Assigned Numbering Authority) hands out blocks of addresses to regional centres see http://www.iana.org/ In Europe this is through RIPE (Reseaux IP Europeans) to support pan-european IP network, see their web site at: http://www.ripe.net/ they act as regional centre for Europe ARIN (American Registry for Internet Numbers) previously through InterNIC APNIC (Asia Pacific Network Information Centre) Networks and Data Communications 15
Other network stacks TCP/IP is only one networking stack (see 7 layer OSI model) some others include IPX/SPX (from Novell) IPX (Internetwork Packet exchange): connectionless and based on datagrams. It performs addressing and routing, and is many ways similar to IP (and UDP) SPX (Sequenced Packet exchange): connection based, supports the reliable delivery of packets and supports flow control very much like TCP IPX/SPX are particular optimised for PC based Local Area Networks Networks and Data Communications 16
Tunnelling IPX through IP NetWare (Novell) enabled IPX/SPX local area networks to be connected over TCP/IP internetworks. To achieve this, IPX packets are encapsulated in IP packets which are then forwarded through TCP/IP internet to downstream NetWare servers, where they are unpacked and used Routing is achieved via the TCP/IP network NetWare server is required to detect whether incoming packet which is to be routed via TCP/IP network contains IP or IPX packets Novell s ODI (Open Data-Link Interface) enables a device-independent driver interface for network interface cards enabling various networking protocols to be defined without requiring detailed knowledge of underlying hardware This is very much the notion of supporting a virtual machine (as in Java) but at the network card level. Hence, multiple networking protocols (like IPX/SPX) can co-exist Networks and Data Communications 17
with TCP/IP, through multiple, simultaneous, network stacks
Network Management and SNMP How do we manage large networks? lots of tools are provided with standard operating systems such as Unix to help us achieve this such as ping, netstat, ipconfig etc However, these tools are not integrated, and hard to combine although many hackers (in a good way) can write shell scripts (perl, unix shell etc) to integrate commands together and has been the traditional approach in managing Unix based networks in particular Networks are more complex, and many require remote administration hence the advent of the Simple Network Management Protocol (SNMP) Networks and Data Communications 18
Three main components: Components of SNMP Manager utility: The interface that provides the interaction between a network administrator and the system. Generally, a utility with a graphical interface showing different nodes in the network and their properties The Managed Object: This can be any component within the network and is a very general concept. The size of such an object can vary from being a single network interface card, to a complete LAN or even multiple LANs. The concept of a managed object can also be more abstract such as a coffee pot connected to the network hence, if it is hooked to the network it is a managed object! Software on managed object (usually called an Agent): This software monitors the managed object to which it belongs, and receives requests from the manager via the GUI. It can also be used to specify and update properties of Networks and Data Communications 19
the managed object, and transmits information about the managed object to the network administrator at predefined intervals of time.
SNMP Components... 2 A network management system should therefore enable: A means of identifying the managed objects in the network A means of specifying the actual objects associated with this abstract concept and the properties of the physical object A means of communicating between the manager, and agents that control the managed objects To support this there is an: Structure of Management Information (SMI): How to identify and describe objects Management Information Base (MIB): Information repository about the objects Networks and Data Communications 20
Simple Network Management Protocol (SNMP): Communication protocol between the manager and the agents
SMI Object Naming Objects are named using a hierarchical structure RFC 1155 very much like a Domain Name Server (see later!) At each level of the hierarchy, the objects are assigned an integer number to specify an exact object, one must concatenate the numbers of the objects to build a path through the hierarchy from the root 1.3.6.1.2.1.5 This can be confusing (no kidding!) so there are also string or text based names associated with levels in the hierarchy Networks and Data Communications 21
MIB Object Namespace Networks and Data Communications 22
root iso (1) ccitt (2) joint iso-ccitt (3) org (3) 1.3 dod (6) 1.3.6 internet (1) directory (1) management (2) experimental (3) private (4) 1.3.6.1.2
MIB... 2 Full hierarchical namespace is very large the root has no name only descendant controlling organisations Nodes can be referenced via their. separated integer names, or their string names hence 1.3.6.1.2 can also be labelled as internet 2 A main Internet MIB defines the set of objects that can be interrogated with respect to TCP/IP protocols these are located under the main mib entry off internet management (1.3.6.1.2.1) and defines a number of objects: system: identification and information about systems on the network interface: information about network interfaces at: address translation ip: information about the IP Networks and Data Communications 23
and similarly for other aspect of internet protocols (like ICMP, TCP, UDP, EGP etc). The Internet MIB is managed by IAB (Internet Activities Board) All SNMP managers understand the internet MIB and so can gather information from the managed nodes on the network Also possible to have private MIBs these are vendor specific and relate to objects sold by a particular vendor such as IBM. This corresponds to the address 1.3.6.1.4 this facility enables specialised product vendors to defined product categories or ranges Vendors offering private MIBs should provide information in a standard format and will include an agent to manage the product.
SNMP Simple protocol for communication between the manager and agents makes use of UDP with reserved ports for the manager and agent (manager is on port 161, and every agent on port 162) Aim in developing this protocol is to offer as little overhead as possible hence very simple with minimal features supported Manager can either inquire about the properties of an object or can set attributes on the managed object Agent replies to messages from the manager with information or diagnostic messages the agent can also send messages (called traps) to indicate exceptional conditions in the managed object GetRequest: Fetch one or more value(s) from a specified object variable Networks and Data Communications 24
GetNextRequest: Fetch value(s) without specifying the exact name. This process can iterate through the entire MIB SetRequest: Set specified variable to specified value Response: Reply to one of above get or set requests Trap: Message indicating some event at an agent. A trap is sent to a specific or a set of manager(s) SNMP agents can be grouped into communities hence to make a request (get or set a value) of an agent, the manager must know the community name and specify it with the request useful to support security in SNMP
SNMP v2/v3 Versions 2 and 3 of SNMP provided: Enhanced security features such as support for Message Digest5 (MD5), and DES Private Key Encryption. Authorisation and Access Control was also support, to a limited extent, per object being managed. Enhanced gets and sets so that if a value was not available the protocol would still be able to cope and in this context, enabled better support for handing errors Hierarchical managers where one manager could interact with multiple others lower down this is based on the concept of a proxy-manager and based on the use of inform requests. Proxy agents can control isolated or non-snmp networks Various SNMP products on the market command line tools such as snmpget, snmpset, to tools from particular Networks and Data Communications 25
vendors Sun NetManager (SUN Microsystems), NetView/6000 (IBM) etc
CMIP CMIP (Common Management Information Protocol) developed by ISO and makes use of the full 7 layer protocol CMIP implemented over TCP/IP and was created to replace SNMP however, this is not really happened! The definitions of SMI and MIB are not necessarily tied to SNMP exclusively hence, if alternative network-management approaches are employed, they can still be used to for object-specification Networks and Data Communications 26