Showing posts with label Networking. Show all posts
Showing posts with label Networking. Show all posts

Sunday, February 24, 2013

Does the Internet Work?

Does the Internet work?  Is it a success?

There are a few ways to answer these questions.  It might seem obvious that it is a success, since the whole world is connected or about to be connected.  Global domination is the very definition of success, isn't it?  We could try other definitions, such as happiness.  Does the Internet make us happier?  This would be hard to answer in a blog post.

Another approach is to use the original goals of the architects of the Internet as a benchmark.  In 1987, David Clark wrote a retrospective paper describing these goals.  Clark was the Chief Protocol Architect for the Internet in 1981, and he remains an Internet visionary today.

Goals:
  1. Develop an effective technique for multiplexed utilization of existing interconnected networks.
  2. Internet communication must continue despite loss of networks or gateways.
  3. The Internet must support multiple types of communications service.
  4. The Internet architecture must accommodate a variety of networks.
  5. The Internet architecture must permit distributed management of its resources.
  6. The Internet architecture must be cost effective.
  7. The Internet architecture must permit attachment with a low level of effort.
  8. The resources used in the Internet architecture must be accountable.
Some reflections:
  1. Though it's hard to remember today, the Internet was originally a military program.  It was designed to withstand nuclear attack.  This goal (1 and 4), coupled with the desire to interconnect existing networks and networking protocols (0, 2, 3, and 5), led to the design choices of 1) a packet-switched network of dumb routers with 2) the datagram as its base messaging unit. 

    A packet-switched network transmitting datagrams meets many of the goals of the Internet architects, but it has some serious trade-offs.  Because the Internet is stateless, error detection, retransmissions, and security must be handled at the end hosts.  The network just does the best it can to transmit datagrams.  There are no other perks.

    In many ways, this was a pragmatic decision: there was a large installed based of existing hardware, and it would have been difficult to convince people to start again with specs designed by the military.  The architects had no idea how widespread the Internet would become.  Still, it was a military application.  You would think that security, at least, would need to be baked into the network.

    Interestingly, decentralization led to many social, political, commercial, and economic consequences that typically are not high on the list of military priorities.  I have never worked in defense, but I understand that there is an emphasis on chains of command and accountability.  I can't think of anything less hierarchical or accountable than the Internet.

  2. Speed is not a goal.  Isn't it funny that a communications protocol using telephony cannot transmit real-time voice communication?  The packet-switched network was designed to route around network failures.  There is no guarantee that packets arrive in any order or within any period of time.  For this reason, packets have a lot of overhead in the form of message headers.  The packet-switched datagram is a relatively slow form of communication.  It wasn't until broadband was widely available that VOIP became feasible. 

    Much traffic today is composed of message headers, retransmissions, and flow control information, all of which could be better handled by a stateful network.  A stateful network would be more like the phone system, in which dedicated lines handle streams of information.  These lines would have to be easily reroutable to handle interruptions to the system (such as nuclear attack), but packet-switching is not the only way to do this.

  3. Accountability (i.e., monitoring) dropped off the list.  Since it was a military application, the Internet Architects wanted to be able to account for its uses and abuses.  However, it would have been very difficult to develop monitoring systems in a stateless network.  After all, the monitoring system AT&T uses for billing is about as complex as the telephonic network itself, and that is a stateful system.  For this reason, accountability was quickly dropped from the list of goals.

    Since there is no monitoring within the network itself, all accounting must be handled at the application layer.  TCP has to figure out what speed it should transmit by monitoring dropped packets.  Denial-of-service attacks have to be handled by firewalls.  Routers can simply declare what addresses they can handle.  And, of course, speed can't be a goal if there is no way to measure performance.
In short, the Internet is not a perfect system.  It meets many of its goals, but its architects faced a trade-off between stateful and stateless systems.  Stateful systems are good for speed, error-handling, security, and accountability, but a stateful Internet would require more expensive hardware and a reworking of the entire system.  A stateless system is cheap and simple, but it is slow and requires hosts to handle any advanced features.  At the end of his paper, Clark suggests that the packet-switched datagram was a compromise and that a 'soft state' system composed of streams may have been better.

Like the Internet architects, however, we have to be pragmatic.  The ubiquity of Network Address Translators (NATs) forces us to stick with TCP/IP.  Because NATs read and rewrite message headers, there has to be agreement on the protocols in use.  If we wanted to change protocols, we would have to throw out all our routers and modems.  Of course, new protocols could be created on top of TCP/UDP/ICMP, but these would have the same shortcomings as the layers below.

Sunday, January 20, 2013

How the Internet Works

I never really had a proper introduction to networking until taking an online course.  I recommend the course, even for people with little experience in technology.  It's really not rocket science.  A network engineer, and former plumber, I know claims it's exactly like plumbing--"It's all pipes," he says.

Network engineers may be a bit like plumbers, but the architects of the Internet were cultivators of complex systems.  They needed to find a balance between being too rigid and thus hampering future innovation on the one hand, and being too open and thus causing Tower-of-Babel-like chaos.  These architects used at least two key conceptual tools to manage complexity: encapsulation and layering.  Software developers should be familiar with both terms.  For example, object-oriented programmers use encapsulation to abstract away the details of application code from their use, and they make use of layering to decouple functional domains.

This is all a fancy way of saying that the development of complex systems requires black boxes.  It's impossible for any one person to understand everything that is going on in a reasonably complex system, so we must be able to say, "Well, we're not going to worry about that right now."  Furthermore, if a change in one place requires a change in ten other places, you have a very fragile system.

The Internet has four layers.  In the highest layer, applications talk to each other without worrying about any of the messy details.  For example, your browser just requests a web page--it doesn't care how it gets there.  The transport protocol (probably TCP) establishes connections and ensures that data is reliably delivered in sequence.  It also manages congestion.  TCP doesn't care how the data segments are transmitted.  This is the job of the network layer, most likely IP.  IP is a simple delivery service that does its best to get a message from one location to another.  Routers direct traffic to the appropriate address based on routing tables, but there is no overall plan for the path packets should take.  Finally, the link or physical layer is composed of the actual cables or wireless hardware.  It relays bits, but it has no idea what the bits mean.

What's amazing about the Internet is that it hasn't changed much in forty years.  We've never had to start over from scratch.  We didn't have to stand by while the Masters of the Internet upgraded to version 2.0.  In fact, it works so well that we usually don't have to think about it.  Changes to the Internet, such as ARPAnet's upgrade to TCP Tahoe in 1986, happened pretty seamlessly.  The current switch to IPv6 is transparent.

The main reason for the Internet's resiliency is its use of layering and encapsulation.  Because each layer functions independently, its implementation is encapsulated or hidden from the layers above.  For example, there has been a proposal to implement IP via carrier pigeons.  The application and transport layer would still work the same, just a bit slower.

Layering and encapsulation are made possible by using a message-in-a-message technique, much like Russian stacking dolls.  Network traffic is comprised of messages.  TCP calls them segments, IP calls them datagrams, and Ethernet calls them frames, but they're all composed of a payload and a message header containing instructions for a particular protocol.  The payload may contain another message consisting of another header and payload, and so on, down to the physical layer.

For example, when you go to a website, you use the HTTP protocol (application layer).  Each HTTP response has a header and a message.  A response header returns a GET header with the web page as the message.  This response is broken up into the payloads of messages with TCP headers (transport layer).  These message headers have instructions ensuring safe delivery.  The TCP messages are the payloads of yet other messages, having headers with IP destination instructions.  Finally, these messages are the payload of yet more messages having headers containing ports and MAC addresses.

The message-in-a-message technique is simple yet powerful.  For example, VPN works by recursively layering messages.  You might have an HTTP request in a TCP segment in an IP packet in a secured TLS presentation message in a TCP segment in an IP packet in an Ethernet frame.  Requests over VPN are encapsulated within normal Internet traffic.

IPv6 works in a similar manner.  We've already started to run out of all 4.29 billion IPv4 addresses (the familiar 192.168.1.1) and we have begun using IPv6's 3.4×1038 addresses (the not-yet-familiar 2a91:0db8:85a3:0000:0000:8a2e:0370:7334).  We don't need two Internets to support both network protocols thanks to a technique called tunneling.  Network Address Translators can transmit IPv6 datagrams over IPv4 routers by simply putting IPv6 datagrams inside IPv4 ones.  That is, IPv6 tunnels through existing IPv4 networks.

We don't know what the Internet will look like 100 years from now, but it will probably have new layers stacked on top of or recursively contained within existing layers.  It will evolve piecemeal, without major upgrades causing blackouts.  It may swap out TCP for some other, more efficient communications protocol, or it may replace the physical layer with faster wireless relays.  Because of layering and encapsulation, changes to any one functional layer will have no impact on any others.
Related Posts Plugin for WordPress, Blogger...