Communication Protocols
Exercises
Question 5.1
What is the maximum number of hosts on a TCP/IP internet?
- Answer
The first, approach - which uses the classful address - considers the use of Class A network since the network address is made up of network ID (8-bits) and host ID (24-bits). Also note that the 8-bits must be in the format: 0XXX-XXX (X here indicates we don't care about the value as the leading 0 indicates the Class A network and - is used to make it easier for reading purpose.) and we could store 2 raised to 24 - 2 (2^24 - 2 or 16,777,214) hosts. Note that although the text doesn't mention about it, but two (2) is decremented from the number of hosts as one of them is the network address, and the other one is the broadcast address.
Another approach, which is similar to subnetting in concept (but unlike subnetting, where the host ID is split into subnetwork ID and host ID), is the supernetting technique. We know that the subnet mask is increased when subnetting is performed. Supernet makes it possible for the subnet mask to be decreased. Recall that the subnet mask for a Class C network is denoted as /24, indicating that the network ID and hsot ID is obtained by logically ANDing all the bits in the network address by 24 consecutive 1's followed by 8 0's. Class A networks have the subnet mask of /8.
Now, theoretically speaking, we could have the subnet mask as low as /1, which means, we could assign rest of the bits (31) to hosts. This means we could allocate 2 raised to power of 31 (2^31 - 2 or 2,147,483,646) hosts. This techniques utilizes the "Classless Inter-Domain Routing or CIDR", which is not described in the text. Now, this could create issue as classful addresses have a pattern, like Class A starting with a zero (0), Class B starting with a one (1) followed by a zero (0), and so on till Class D. This means, the 4 bits in any network address is used to identify the class of the network. Although the idea of Classful addressing becomes irrelevant these days, it should be noted that aggregating the networks (supernetting) technique, whilst it is possible that we can make a network with subnet mask of /1, practically, it usually is /16 or /24 (yes, not even /8) due to difficulty in network management and other hurdles.
Question 5.2
What is the maximum number of hosts on a XNS internet?
- Answer
Recall that 32-bits (4-bytes) are assigned in a XNS network for the network address, and 48-bits (8-bytes) are assigned for the hosts in the particular network. The host ID is written as six hexadecimal digits (0-F) separated by a period (.). So, a typical host ID on a network (which, unlike the TCP/IP - where the host ID is relative to network ID - is a flat address space) will look like: AA.CC.FF.00.33.88.
Coming back to numbers, this means that XNS network can have 2 raised to power of 48 (2^48 or 281,474,976,710,656). Yes, this is the maximum hosts that a particular network address could support in a Xerox Netowk System (XNS).
Question 5.3
Given the addressing structure of TCP/IP and XNS, would it be feasible for every home in the U.S. to have a unique network address? How about every home in the world?
- Answer
There will be two answers for this question: one which takes in the population in the 1990s (when the text was written) and one which takes in the population in 2024 (the time when I'm learning from the text).
First case, in the 1990, the population of U.S. was 248,709,873 [1]. As the question specifies if it is "feasible for every home in the U.S. to have a unique network address", we will take into account the Internet network address. Since the network address is made up of 32-bits (4-bytes), which can be represent 2 raised to power of 32 (2^32 or 4,294,967,296). NOTE: This does not consider the addressing structure of TCP/IP. When we consider that (we won't be talking about CIDR), we know that a single Class A network can support 16,777,216 (not taking network address and broadcast address into account) hosts. Clearly, there are more Class A netowrk and other techniques such as CIDR are used to not limit the restrictions imposed by Classful addressing techniques.
Also, we know that XNS has 32-bits for network address AND 48-bits for host address. So, it is possible to not only have a unique network address for every person (and homes) in the US, but also, in the world.
Okay, looks like I missed the "every home" part, so let's look into it as well. Based on the data provided [2][], we can see that the U.S. had ~102,263,678 homes (detached: 60,383,409, attached: 5,378,243, 2 to 4: 9,876,407, 5 or more: 18,104,610, Mobile home: 7,399,855, Other: 1,121,154) in 1990. We can clearly see that by only using one network ID, it is not possible to have a unique network address for each house in the U.S., let alone the whole world.
Second case, in 2024, the population of U.S. is 337,371,132 (and the global population 8,083,381,150) [3] and the number of housing units in the US is 145,344,636 [4]. We can clearly observe that despite the number of theoretical networks being over 2 billion, there isn't enough addresses for every device that connects to the Internet. If we consider the number of Class A network addresses, a single Class A network can store 16 million hosts. Since the network ID is of 8-bits, there could be atmost 256 Class A network address (where the network ID of 10 is reserved for private network that cannot be assigned to the public Internet address space. NOTE: Internet Exchange Points (IXPs) or ISPs cannot use these addresses to route between networks, but can be used in local networks). Also, there are limitations to using these classful addresses as they have a fixed number of hosts which cannot always suit the network architecture. Because of those limitations, despite being able to classify ~4 billion hosts, IPv6 aims to be a successor of IPv4.
[1]. https://en.wikipedia.org/wiki/1990_United_States_census
[2]. https://www2.census.gov/programs-surveys/decennial/tables/time-series/coh-units/units1990.txt
[3]. https://www.census.gov/popclock/?os=app&ref=app
[4]. https://www.census.gov/data/tables/time-series/demo/popest/2020s-total-housing-units.html
Question 5.4
Compare the OSI connectionless network service (5.6.3) with IP.
- Answer
One of the major difference is that an IP header contains the IP address of size 32-bits (4-bytes) but OSI IP can be of variable-length for the address field. Also note that X.25 (ISO 8878) protocol specification resembles the TCP from TCP/IP protocol suite, where X.25 provides a connection-oriented protocol. Not only does it provide protcols for layer 3 (network), it provides protocols for layer 1 and 2 as well. Also, similar to how UDP is a connectionless protocol which transmits data over IP without having any form of circuit (virtual-circuit), there is a specification for connectionless transport protocol similar to UDP (an addendum to the previously defined Connection-Oriented transport protocol). The connectionless network service is utilized by the connectionless transport protocol, which acts similar to UDP as it contains the source and destination address, the data/payload and an optional checksum.
Realize that the X.25 protocol suite is entirely a connection-oriented protocol, where out of five defined classes, in Transport Protocol (TP) class 4 only, the tranport protocol assumes the network service provided is unreliable (network service type C). This is different from the IP protocol, since IP inherently is a unreliable network which provides a connectionless service to the upper layers (hence why it is the job of TCP to provide a connection-oriented service to application layers) and no forms of error handling.
Also realize that even though Network service type A (reliable network with error handling), type B (reliable network with error notificaiton to upper layers), and type C (unreliable network with no error handling functionality) are assumed for the transport layer, it should be noted that the Transport Protocol Class 4 - which uses Network service type C - not only supports protocols defined in X.25, but also to interop with other protocols (like the connectionless protocol which is an unreliable service).
Programs
Tools
- Program
- Output
Makefile
iptohex.c
port_check.sh