Some material adapted from
Computer Networking: A Top-Down Approach Featuring the Internet
3rd edition, copyright 2005 J.F Kurose and K.W. Ross, All Rights Reserved.
Internet Architecture
The Internet is made up of edge components, core components, and communication media:
-
Network edge
- The network edge consists of applications running on
host
computers. Hosts run programs such as email clients, web browsers, email servers, and web servers. The most popular model for communication on the Internet is the client-server model. Clients request and receive services from servers that are always on. In the peer-to-peer (P2P) model, hosts communicate as equals. A host can typically operate as both a client and a server.
-
Network core
- The network core consists of a series of
routers
that receive messages from sending hosts or other routers and pass them along until they arrive at the receiving host.
-
Communication media
- Hosts and routers connect via communication links. Links may be wired or wireless.
Internet Service Models
Programs send messages over the Internet by using
sockets
. A socket is an input or output stream that allows an application to send or receive messages. Communication via sockets can be reliable, using the Transport Control Protocol (
TCP
), or unreliable, using the User Datagram Protocol (
UDP
). Programs such as email and web browsing use TCP. Programs such as streaming media, that are time sensitve but can tolerate loss, use UDP.
The Life of a Packet
A message sent by an application is often referred to as a
packet
. From the programmer's perspective, sending a packet involves the following steps:
-
Prepare the packet.
-
Connect to the receiver by using the receiver's Internet Protocol (
IP
) address to open a socket.
-
Retrieve the output stream created by the socket.
-
Push the packet into the output stream.
From the computer's perspective, there are many more steps involved. If reliable communication is desired, the networking stack must keep track of which packets have been sent and which have been received. It must also determine the best route a packet should take through the Internet. Finally, it must determine how to contact the next router along the path to the receiver.
The Internet protocol stack is comprised of 5 layers. These layers decompose the complex functionality of the Internet into manageable pieces.
-
Application - The application layer composes messages to be sent to a receiver.
-
Transport - The transport layer ensures that communication is reliable and also ensures that each host not take up more than its fair share of the bandwidth.
-
Network - The network layer determines how packets should be routed.
-
Data Link (or MAC) - The data link layer addresses how neighboring hosts and routers communicate.
-
Physical - The physical layer addresses how bits are sent on the wire.
Protocols and SMTP
Networked entities communicate using a series of
protocols
. A protocol defines the format and order of messages used for communication. The HyperText Transfer Protocol (
HTTP
) defines the messages exchanged between a web browser and a web server. To retrieve a web page, you can telnet directly to a server and type
GET /<path to page>
. The server will respond with the page, or with a 404 Not Found message. Following is an example that retrieves my web page: