It is hard to find anywhere today that is not somehow connected to a network. In the past, very few people had access to networks, however these systems of communication have quickly become a part of our everyday life, both at work and at home. If you are pursuing a career in, or are merely interested in networking, the interconnection of networks is a vital part of the topic, and is becoming more and more important. In order to have a clearer understanding of the Internet and how computer networks communicate, it is necessary to explore "Internetworking".
Aspects of Internetworking
A computer network is a group of computers that communicate with one another. There are various mediums through which they can communicate, including wire, cable, optical fibre, radio waves, micro waves, infrared signals, and laser beams.
A computer network requires that there be a set of rules to be used when exchanging messages. This is referred to as a protocol. A set of rules that specify the format of messages and appropriate actions for each message is a computer communication protocol or network protocol.
To ensure that protocols work well together, a set of protocols are designed and developed as a single suite or family where each protocol does its part to solve the communication problem at hand. This is most often called a protocol suite.
The design process for protocols is helped by a tool known as a layering model which divides a communication problem into subpieces called layers.
The OSI Networking Model Layers
One of the most common layering models was defined by the International Organization for Standarization (ISO). This is a seven-layer reference model which represents a network and its protocol/hardware relationships in seven parts. It is known as the "OSI Model":
Application Layer | This layer specifies how an application uses the network and how an application program on one machine makes a request and how another responds. |
Presentation Layer | This layer specifies how data should be represented because different computers use different internal representations of data protocols to translate from data on one machine to data on another. |
Session Layer | This layer specifies how to establish, maintain, and terminate a communication session with a remote computer. |
Transport Layer | This layer specifies how to perform reliable transfer of data from one computer to another. |
Network Layer | This layer specifies how network addresses are assigned and how data is routed from one computer to another in the form of data items broken down into network blocks called packets. |
Data Link Layer | This layer specifies how data is broken down further into frames which are packets wrapped in additional data link information, and how these frames are transmitted over the network. |
Physical Layer | This layer specifies various forms of network hardware and how data is transmitted in its physical form as some sort of wave or pulsing electrical signal. |
The order in which a message or data from Server 1 is disassembled through the network layers until it reaches the shared physical layer between the two computers and is reassembled travelling up the layers of COMPUTER 2.
COMPUTER 1 | COMPUTER 2 | |
Application | Application | |
Presentation | Presentation | |
Session | Session | |
Transport | Transport | |
Network | Network | |
Data Link | Data Link | |
Physical | ======> | Physical |
Internetworking: The Interconnection of Networks
An internetwork is the resulting system of connected physical networks. There are many difficulties associated with the interconnection of networks. Imagine the Internet with its various networks around the world using different platforms, operating systems, software, hardware, standards. It is a daunting task to overcome these differences and allow for computers to understand, transmit and reproduce data.
If you have networks which use different technologies (heterogeneous networks) a hardware component is used to connect them known as a router. A router is a special-purpose computer dedicated to the task of interconnecting networks that use different technologies.
The purpose of internetworking is to provide universal service across these differing networks. Protocol software is required on computers to make this possible. Internetworking defines an abstract or virtual network because it hides the physical realities of the network connections and offers a communication system which creates the illusion that each computer is directly connected to the others on the network. Thus it fools the computers into thinking that they are directly connected, and it makes communication easier.
This is how the Internet works. Computers that connect to an internet and run applications are called hosts. If you have a temporary connection to the Internet through a service provider, your computer acts as a host. The host is generally a very powerful server that has extensive memory and processing resources.
In addition, routers and hosts both depend upon protocol software, namely a protocol suite
known as TCP/IP.
Aspects of TCP/IP
TCP/IP stands for Transmission Control Protocol/Internet Protocol. This is a protocol suite or set of rules for connections between networks of dissimilar computers over an internet.
In the 1970s, TCP/IP was developed by the Defense Advanced Research Projects Agency (DARPA) for military use. DARPA started an internetwork called ARPAnet which utilized TCP/IP.
TCP/IP is popular because it is the protocol used on the Internet, the public and global medium for the effective transfer and exchange of data. Both protocols work together to transmit information with accuracy and precision across the Internet.
The TCP/IP Layering Model
TCP/IP uses a networking model with four layers that is different from the OSI networking model discussed in the last tutorial part.
Application Layer | This layer specifies how application requests from one computer to another are handled, how data representation conversions between these two computers are dealt with, and how communications are initiated and terminated on the network. |
Host-to-Host Layer | This layer specifies how to ensure reliable data transfer from one computer to another, and also levels or acknowledgement and flow control. |
Internet Layer | This layer specifies the format of packets sent across the internet as well as the mechanisms used to forward packets from a computer through one or more routers to a final destination. |
Network Access Layer | This layer specifies how to receive and transmit datagrams as well as various forms of network hardware and how data is transmitted in its physical form as some sort of wave or pulsing electrical signal. |
Internet Protocol(IP)
For internetworking to simulate a single connected network, internet protocol software is used to hide the physicality of attached networks. To deal with the differences from network to network, an abstract addressing scheme was created which enabled protocol software to hide the details and size of underlying hardware addresses.
The Internet Protocol standard specifies that each host be assigned a unique 32-bit number called the host's Internet Protocol address or IP address which is used for all communication with the host.
IP addresses are divided into two parts. The first part is the network address or network number defining the physical network. The second part is a unique number defining a specific computer attached to this network, known as the host address.
NETWORK ADDRESS | HOST ADDRESS |
Primary Classes of IP Addresses
The first four bits of an IP address indicate which address class it belongs to. IP addressing classes help to define the general size of a network and allow for virtually unlimited IP addresses to exist.
If a network becomes too large, it may be divided into subnetworks. However, if the network has been assigned one IP address alone, rather than request a unique IP address for each subnetwork, a technique called subnetting can be used. In this case, the host address of an IP address is divided into two parts: one for the host address itself and a second part for the subnet address.
Subnet Masks
To the external world, the IP address of the network does not change but locally, the machine is defined as being a specific host. A 32-bit number known as a subnet mask is applied to an IP address
Subnet mask: 255.255.255.192
IP address: 193.67.108.135
When converted to binary values:
135 is converted to 10000111
192 is converted to 11000000
The 1's in the mask indicate the subnet portion of the IP address and the zeros indicate the host address portion. To understand more clearly we can split into Subnet/Host address parts:
SUBNET | HOST |
10 | 000111 |
11 | 000000 |
000111 is converted back to decimal and we find that the host address is 7.
10 is the subnet portion and we fill this with zeros to the right and convert back to decimal to get 128.
Host Address = 7
Subnet Address = 128
Add these values together and we should get the original host portion of the IP address which appears as the same IP address on the internetwork.
128 + 4 = 135
IP address: 193.67.108.135
Subnet address: 255.255.255.192
Address Resolution
Address resolution occurs when a protocol address is resolved to the correct hardware address. This occurs when a host or a router on the same physical network sends a message.
TCP/IP includes an Address Resolution Protocol(ARP) defining two basic message types: a request and a response.
IP Datagrams
An internet packet is called an IP datagram, which consists of a header followed by data. The header contains the source IP address and the destination IP address. Datagrams are part of a connectionless service which makes the best effort to deliver the data but does not guarantee delivery.
IP HEADER | IP DATA AREA |
The application that sends a datagram defines the size of the datagram. It has essentially the same structure as a hardware frame and can be placed in the data area of hardware frames on heterogeneous networks. The hardware frame is said to encapsulate the datagram. If the datagram is larger than the maximum transmission unit(MTU), it is broken down into fragments and reassembled at the destination end.
IP HEADER | IP DATA AREA |
FRAME HEADER | FRAME DATA AREA |
Internet Control Message Protocol(ICMP)
ICMP is a protocol which enables IP to include error detection and reporting mechanisms for transmission problems. Routers send ICMP error messages to the original source of the datagram which caused the problem.
Transmission Control Protocol(TCP)
TCP is the major transport protocol in TCP/IP. It uses the datagram service IP offers and provides a reliable data delivery service to application programs. This is a connection oriented service.
TCP includes seven features:
Connection Orientation
This feature requires an application to first request a connection to a destination and then use the connection to transfer data.
Point-to-Point Communication
This feature defines a TCP connection as having exactly two endpoints.
Complete Reliability
This feature guarantees that data sent across a connection will be delivered exactly as sent, with no data missing or out of order.
Full Duplex Communication
This feature allows data to flow in either direction, and allows either application program to send data at any time.
Stream Interface
This feature defines a stream interface in which an application sends a continuous stream of data acrossa connection.
Reliable Connection Startup
This feature requires two applications creating a connection to both agree on establishing the new connection.
Graceful Connection Shutdown
This feature guarantees that an application program can open a connection, send arbitrary amounts of data, and then request that the connection be shut down, with all data reliably delivered before the connection is closed.
The major benefit of TCP is the reliability achieved and this is achieved through a form of retransmission. When data is received at the destination TCP requires that acknowledgement be sent back to the sender. A timer is used when data is sent and if it times out for an item of data without receiving an acknowledgement, it resends this item of data.
From the user's point of view, when you download a file from the Internet using File Transfer Protocol(FTP), it is using a form of TCP to break down a large file into packets and verifying that you receive each packet sent. On the other hand, when you e-mail a message to a friend, there is not this connection established or the same reliability. The message is simply forwarded as a type of datagram directed to your friend's IP address.
TCP/IP is the way of doing things on the Internet. You send an e-mail message and it breaks
down into smaller pieces that eventually becomes plain pieces of data that can be transmitted
across different kinds of networks. When the message fragments reach the destination, it is
rebuilt to duplicate what you sent.
Aspects of Internet Sockets
In relation to the internet, sockets are often associated with the TCP/IP protocol suite as means of transferring information across the world wide web from one computer to another.
When you send an electronic document or picture or whatever then the program breaks it down into fragments of data to be sent across the internet. The responding program receives the data and reassembles it on the other end. As far as the user is concerned, the information was just thrown down a nifty chute leading right to the recipient.
Sockets define an Application Programming Interface (API) available for many systems defining a way for coders to build applications which interact with protocol software.
A common socket interface hides the specific internals and externals of data transfer, allowing a common model to represent a pipe or socket which data can travel through which leads to the recipient program, holding the other end of this socket.
The most widely used is the Berkeley Sockets interface developed at the University of California (Berkeley) for the UNIX operating system. The Windows Socket API or WinSock is a specification developed by a consortium of companies in an effort to standardize TCP/IP usage under Windows.
WinSock is modelled after the Berkeley interface so I will discuss the general operation of sockets and not the subtle differences between these respective interfaces.
Now I will step through the stages of using the socket API in a software application:
Creating a Socket
iSocketDesc = socket(protoFamily,type,protocol)
The goal of the socket call is to retrieve an interger descriptor for the socket, sort of like a file handle. This value can be used to refer to this particular socket in other API function calls.
iSocketDesc | integer description to refer to created socket by. |
protocol Family | protocol family to be used with the socket. For the TCP/IP protcol family, this value should be PF_INET. |
type | communications type to use for the socket. SOCK_STREAM defines a connection-oriented socket. SOCK_DGRAM defines a socket performing connectionless transfers. |
protocol | protocol in the protocol family to use for this socket (TCP or IP for PF_INET). |
Binding a Socket
bind(iSocket,localAddr,addrLen)
Although the socket call creates the socket, it has no local or remote address. A server uses the bind function where the a protocol port number is submitted, indicating where clients should connect to access its services.
iSocket | descriptor of the created socket not yet bound to an address. |
localAddr | socket address structure defined by the socket API. |
addrLen | length or size of socket address |
Listening for a Socket
listen(iSocket,queueSize)
Now the socket is ready to exist in passive mode, waiting for a client socket to connect with it. The server calls this listen method.
iSocket | descriptor of the created socket bound to an address. |
queueSize | maximum number of clients to handle at once. |
Accepting a Socket
clientSocket = accept(serverSocket,clientAddr,clientAddrLen)
If connectionless transport is being used, a message can be sent already, making this stage unnecessary. This stage is only required for connection-oriented transport.
clientSocket | integer descriptor of the connecting client socket returned. |
serverSocket | integer descriptor of the server socket. |
clientAddr | client's socket address structure returned. |
clientAddrLen | length or size of client socket address returned. |
Connecting to the Server
connect(clientSocket,serverAddr,serverAddrLen)
Please note that connect is being used by the client program to form a connection with the server socket. The client calls socket to create a socket and then connect, which is what the server program listens for. This function exists from the client's point of view after the creation stage. This is the other end of the connection from the server's point of view.
clientSocket | integer descriptor of the created client socket. |
serverAddr | address structure of server socket returned. |
serverAddrLen | length or size of server socket structure returned. |
Sending to a Socket
send(destSocket,dataAddr,dataLen,flags)
This function sends data to a connected socket.
destSocket | integer descriptor of destination socket. |
dataAddr | memory address of data to send. |
dataLen | length or size of data being sent. |
flags | special options, mostly for debugging and testing. |
sendto(destSocket,dataAddr,dataLen,flags,destAddr,destAddrLen)
This function is the same as send, only it sends the data to an unconnected socket defined by the socket address in destAddr. destAddrLen is just the length/size of destAddr.
sendmsg(destSocket,msgStruct,flags)
This function does the same operation as sendto, but sends the required arguments in msgStruct, a generic structure containing the destination address and the address length.
Receiving from a Socket
recv(sourceSocket,dataAddr,dataLen,flags)
To compliment the sending functions, a client and server must both be able to receive data. This function receives data from a connected socket.
sourceSocket | integer descriptor of source socket. |
dataAddr | memory address of data buffer for received data storage. |
dataLen | specified length or size of data buffer. |
flags | special options, for peeking at socket message. |
recvfrom(sourceSocket,dataAddr,dataLen,flags,sourceAddr,sourceAddrLen)
This function is the same as recv, only it receives data from unconnected sockets where sourceAddr is the address of the sender socket returned and sourceAddrLen is the length of the sender socket address returned.
recvmsg(sourceSocket,msgStruct,flags)
This function is the same as recvfrom, only it returns the information in msgStruct, a generic structure containing the source address and the address length.
Closing a Socket
close(iSocket)
This function terminates the use of a socket, releasing the descriptor and preventing an application from using it to send more data.
iSocket | integer descriptor of the connected socket. |
Aspects of Java
Java is a programming language. You can use it to make computer programs. Java is popular because you can make programs which work on the Internet. It is owned and developed by Sun Microsystems.
What is Java?
Sun's description of Java:
Java is a "simple, object-oriented, interpreted, robust, secure, architecture-neutral, portable, high-performance, multithreaded, and dynamic language."
Java is Simple:
Java is similar to the C++ programming language but with a powerful set of built-in libraries to automate many tasks. With only a few lines of code, a great deal can be created. Programmers familiar with C and C++ are often comfortable with Java and newcomers to programming can practise their skills in a secure and interesting environment.
Java is Object-Oriented
Java uses software objects known as classes and is based upon reusable, extensible code, meaning that you can both use Java code already created and extend Java code with your own modifications. Ultimately, this means you can do more for less!
Java is Interpreted
When you compile Java code and run it on your system, it is interpreted code. This means that a virtual machine exists on your system running the Java Interpreter which enables your program to run the same way on any system or platform which is also capable of running this Java Interpreter. Learn to speak Java!
Java is Robust
Java removes the use of pointers to memory which are often the source of program bugs and errors in C language. It is much harder to write a Java program which dramatically crashes. Java has a built-in memory management system which includes a Garbage Collector for objects no longer in use which frees the memory used by these remains. Java cleans up after itself!
Java is Secure
Java has various levels of security checking to ensure that Java programs cannot damage your system. You can download a Java program confidently, because it will not contain a virus or element of danger for your system. Don't worry about protection, Java has protection!
Java is Architecture-Neutral
Java applications run across multiple platforms. They are written and compiled into bytecode for Java's virtual machine, which emulates an actual hardware chip. There is currently development on a Java chip for the future which will replace the virtual machine and run Java programs at rocket speed.
Java is Portable
Once again, Java applications run across multiple platforms. The Java Interpreter understands the compiled bytecode of an application and uses that to determine its variables and behaviour when applied to a particular computer system or platform.
Java is High-Performance
Java's bytecode is very efficient because it is compiled to a level near enough to machine code to suffer very little from running above the interpreter.
Java is Multithreaded
Java's high performance is increased by the use of threads. Threads are used to perform tasks that take advantage of unused processor time, sharing the time with other running processes.
Java is Dynamic
Java's architecture allows classes to dynamically load at run-time. This is truly amazing because you can encapsulate code in one Java class and link it to another when you run the program.
With Java, it is possible for you to build a programming piece of the puzzle in a Java class and have a friend in Japan or Germany or wherever add another piece of the puzzle in their Java class and link your code together across the internet when you run the program.
Aspects of Electronic Mail (E-mail)
Electronic mail permits a broad form of communication both inside company networks and outside, allowing virtually any person to send a message to another person across the world.
Generally, E-mail systems can be split into three components:
1. E-mail Client Component
For every mail transaction, a mail reader or editor must be present. This is software that enables a user to write e-mail and send it or receive mail from others, whatever form it may take. This type of client software is also referred to as a user agent(UA).
2. E-mail Server Component
Servers simply store the e-mail messages and if necessary, forward them to other servers. They are also referred to as a mail transfer agent(MTA).
3. E-mail Gateways
Since there are so many different user agents and servers, there must be a common way to translate information. Mail Gateways are used to connect two dissimilar networks. They handle address conversions, file format conversions, and data encoding to allow two different mail systems to communicate.
Simple Mail Transport Protocol(SMTP)
Millions of people use the Simple Mail Transport Protocol (SMTP) to exchange e-mail.
SMTP is the standard for transporting e-mail on the Internet, and uses a simple command-based communication between the sender and receiver. The receiver can be either the ultimate destination server or a mail relay which will in turn forward the mail until to another server until it reaches the correct server. This is considered a store-and-forward mail system.
Post Office Protocol
The Post Office Protocol was developed to allow computers not always connected to the Internet to retrieve their mail messages stored on a larger host computer. Periodically, a client or user agent connects to the server and POP is used to move the e-mail from the server space to a single host machine.
Internet Message Access Protocol(IMAP)
This protocol offers additional capabilities, allowing a user to search selectively for messages and retrieve them based on certain criteria. This permits a user to manipulate remote mailboxes as if they were on the user's computer, even though they are on the server.
E-mail Address Format
E-mail addresses themselves are made of two parts:
kenb_one | @ | yahoo.com |
On the left, there is the local part which is often a username, such as iago from Shakespeare's Othello. This name is actually used by local delivery agents to determine how to handle the message locally and across an e-mail gateway.
On the right, there is the domain part of the address which indicates how the message should be routed on the Internet. It is intergate.bc.ca in this example.
Between the local part and the domain part lies the '@' symbol which is called the 'at' symbol, separating the two parts. In other words, iago at lycos.com is another way to refer to this e-mail address.