Module 5 - DSCE
Module 5 - DSCE
Module 5 - DSCE
• Examples of network-applications:
• In this architecture, there is a server and many clients distributed over the network (Figure 1.1a).
• The server is always-on while a client can be randomly run.
• The server is listening on the network and a client initializes the communication.
• Upon the requests from a client, the server provides certain services to the client.
• Usually, there is no communication between two clients.
• The applications such as FTP, telnet, Web, e-mail etc use the client-server architecture.
• But now, a single-server host is unable to keep up with all the requests from large no. of clients.
• For example:
• The peers are not owned by the service-provider. Rather, the peers are laptops controlled by users.
• Many of today's most popular and traffic-intensive applications are based on P2P architecture.
Each peer also adds service-capacity to the system by distributing files to other peers.
• Advantage: Cost effective ‘.’ Normally, server-infrastructure & server bandwidth are not required.
1) ISP Friendly
Most residential ISPs have been designed for asymmetrical bandwidth usage.
But P2P applications shift upstream-traffic from servers to residential ISPs, which stress on
the ISPs.
2) Security
Since the highly distribution and openness, P2P applications can be a challenge to security.
3) Incentive
Success of P2P depends on convincing users to volunteer bandwidth & resources to the
applications.
1) The processes running on the same end-system can communicate with each other using IPC.
2) The processes running on the different end-systems can communicate by exchanging messages.
ii) A receiving-process receives the messages and responds by sending messages back.
• For example:
5.1.2.1.2 Interface between the Process and the Computer Network Socket
• Any message sent from one process to another must go through the underlying-network.
• Socket is an API between the application-layer and the transport layer within a host (Figure 1.2).
• The application-developer has complete control at the application-layer side of the socket.
• But, the application-developer has little control of the transport-layer side of the socket.
Reliable means guaranteeing the data from the sender to the receiver is delivered correctly.
For ex: TCP provides reliable service to an application.
Unreliable means the data from the sender to the receiver may never arrive.
For ex: UDP provides unreliable service to an application.
Unreliability may be acceptable for loss-tolerant applications, such as multimedia applications.
In multimedia applications, the lost data might result in a small glitch in the audio/video.
5.1.3.2 Throughput
Throughput is the rate at which the sending-process can deliver bits to the receiving-process. Since other
hosts are using the network, the throughput can fluctuate with time. Two types of applications:
2) Elastic Applications
These applications may not need a guaranteed throughput. For ex: Electronic mail, File transfer & Web
transfers.
5.1.3.3 Timing
For ex: guaranteeing every bit arrives at the receiver in less than 100 msec.
→ Internet telephony
→ Virtual environments
→ Teleconferencing and
→ Multiplayer games
5.1.3.4 Security
• The Internet makes two transport-protocols available to applications, UDP and TCP.
• An application-developer who creates a new network-application must use either: UDP or TCP.
• Both UDP & TCP offers a different set of services to the invoking applications.
Table 1.1 shows the service requirements for some selected applications.
1) Connection-Oriented Service
Before the start of communication, client & server need to exchange control-information.
This phase is called handshaking phase.
Then, the two processes can send messages to each other over the connection.
After the end of communication, the applications must tear down the connection.
The communicating processes must deliver all data sent without error & in the proper order.
5.2.1.1 Web
• An object is a file such as an HTML file, a JPEG image, a Java applet, a video chip.
• Most Web-pages consist of a base HTML file & several referenced objects.
• For example:
If a Web-page contains HTML text and five JPEG images; then the Web-page has six objects:
2) Five images.
• The base HTML file references the other objects in the page with the object's URLs.
• For example:
“http://www.someSchool.edu/someDepartment/picture.gif”
In above URL,
1) Hostname = “www.someSchool.edu ”
• The web browsers implement the client-side of HTTP. For ex: Google Chrome, Internet Explorer
5.2.1.2 HTTP
• HTTP is Web’s application-layer protocol (Figure 1.3) (HTTP ol).
• HTTP defines
• When a user requests a Web-page, the browser sends HTTP request to the server.
• Then, the server responds with HTTP response that contains the requested-objects.
• The HTTP client first initiates a TCP connection with the server.
• After connection setup, the browser and the server-processes access TCP through their sockets.
• HTTP is a stateless protocol.
• Stateless means the server sends requested-object to client w/o storing state-info about the client.
• HTTP uses the client-server architecture:
1) Client: Browser that requests receive and displays Web objects.
2) Server: Web-server sends objects in response to requests.
Figure 1.4: Back-of-the-envelope calculation for the time needed to request and receive an HTML file
• A non-persistent connection is closed after the server sends the requested-object to the client.
• In other words, the connection is used exactly for one request and one response.
"http://www.someSchool.edu/someDepartment/home.index"
i.e. Total response time = (i) + (ii) + (iii) = 1 RTT+ 1 RTT+ File transmission time
Hence, buffers must be allocated and state info must be kept in both the client and server.
• With persistent connections, the server leaves the TCP connection open after sending responses.
• Hence, subsequent requests & responses b/w same client & server can be sent over same connection
• The server closes the connection only when the connection is not used for a certain amount of time.
• Advantages:
i) This method requires only one RTT for all the referenced-objects.
• Cookies refer to a small text file created by a Web-site that is stored in the user's computer.
• Cookies are stored either temporarily for that session only or permanently on the hard disk.
→ HTTP response includes Set-cookie: header which contains the identification number (1678)
3) The browser then stores the identification number into the cookie-file.
5) In this manner, the server is able to track user’s activity at the web-site.
A Web-cache is a network entity that satisfies HTTP requests on the behalf of an original Web-server.
The Web-cache has disk-storage. The disk-storage contains copies of recently requested-objects.
Figure 1.8: Clients requesting objects through a Web-cache (or Proxy Server)
2) If the cache has the object requested, the cache returns the requested-object to the client.
3) If the cache does not have the requested-object, then the cache
Advantages of caching:
Conditional GET refers a mechanism that allows a cache to verify that the objects are up to date.
1) Control Connection
The control-connection is used for sending control-information b/w local and remote-hosts.
→ user identification
→ password
2) Data Connection
1) When session starts, the client initiates a control-connection with the server on port 21.
4) FTP sends exactly one file over the data-connection and then closes the data-connection.
5) Usually, the control-connection remains open throughout the duration of the user-session.
6) But, a new data-connection is created for each file transferred within a session.
During a session, the server must maintain the state-information about the user. For example: The
server must keep track of the user's current directory.
Disadvantage: Keeping track of state-info limits the no. of sessions maintained simultaneously
by a server.
• The commands and replies are sent across the control-connection in 7-bit ASCII format.
• For example:
3) LIST: Used to ask the server to send back a list of all the files in the current remote directory.
4) RETR filename: Used to retrieve a file from the current directory of the remote-host.
5) STOR filename: Used to store a file into the current directory of the remote-host.
• For example:
→ hyperlinks
→ embedded photos.
1) User Agents
User-agents allow users to read, reply to, forward, save and compose messages.
2) Mail Servers
Then, the sender’s mail-server sends the message to the receiver's mail-server.
If the sender’s server cannot deliver mail to receiver’s server, the sender’s server
SMTP uses TCP to transfer mail from the sender’s mail-server to the recipient’s mail-server.
When a mail-server receives mail from other mail-servers, the mail-server acts as a server.
When a mail-server sends mail to other mail-servers, the mail-server acts as a client.
5.4.1 SMTP
- If the receiver's server is down, the sending server will try later.
- If connection is established, the client & the server perform application-layer handshaking.
- Then, the client indicates the e-mail address of the sender and the recipient.
- Finally, the client sends the message to the server over the same TCP connection.
→ If message contains binary-data, the message has to be encoded into 7-bit ASCII format.
3) HTTP.
5.4.3.1 POP
POP is an extremely simple mail access protocol. POP server will listen at port 110.
The user-agent at client's computer opens a TCP connection to the main server.
1) Authentication
The user-agent sends a user name and password to authenticate the user.
2) Transaction
The user-agent issues commands, and the server responds to each command with a reply.
i) +OK: used by the server to indicate that the previous command was fine.
3) Update
After user issues a quit command, the mail-server removes all messages marked for deletion.
• Disadvantage: The user cannot manage the mails at remote mail-server. For ex: user cannot delete
messages.
5.4.3.2 IMAP
IMAP is another mail access protocol, which has more features than POP. An IMAP server will associate
each message with a folder. When a message first arrives at server, the message is associated with recipient's
INBOX folder, and then the recipient can
An IMAP server maintains user state-information across IMAP sessions. IMAP permits a user-agent to
obtain components of messages. For example, a user-agent can obtain just the message header of a message.
• Because domain-names are alphabetic, they are easier to remember for human being.
• But, the Internet is really based on IP addresses (DNS Domain Name System).
The DNS is
• DNS servers are often UNIX machines running the BIND software.
• The DNS protocol runs over UDP and uses port 53. (B keley Internet Name Domain)
• Next, the user’s host must first obtain the IP address of www.someschool.edu
1) The same user machine runs the client-side of the DNS application.
2) The browser
4) The client eventually receives a reply, which includes the IP address for the hostname.
5) After receiving the IP address, the browser can initiate a TCP connection to the HTTP
server.
If the DNS server crashes then the entire Internet will not stop.
2) Traffic Volume
A Single DNS Server cannot handle the huge global DNS traffic.
But with distributed system, the traffic is distributed and reduces overload on server.
A single DNS server cannot be “close to” all the querying clients.
then all queries from USA must travel to the other side of the globe.
4) Maintenance
The single DNS server would have to keep records for all Internet hosts.
This centralized database has to be updated frequently to account for every new host.
• Suppose a client wants to determine IP address for hostname “www.amazon.com” (Figure 1.12):
1) The client first contacts one of the root servers, which returns IP addresses for TLD servers
• The example shown in Figure 1.13 makes use of both recursive queries and iterative queries.
• The query 1 sent from cis.poly.edu to dns.poly.edu is a recursive query. This is because
• But the subsequent three queries 2, 4 and 6 are iterative. This is because
• A resource-record is a 4-tuple that contains the following fields: (Name, Value, Type, TTL)
• TTL (time to live) determines when a resource should be removed from a cache.
1) If Type=A, then Name is a hostname and Value is the IP address for the hostname.
2) If Type=NS, then
This record is used to route DNS queries further along in the query chain.
3) If Type=CNAME, then Value is a canonical hostname for the alias hostname Name.
This record can provide querying hosts the canonical name for a hostname.
For ex: (foo.com, relay1.bar.foo.com, CNAME) is a CNAME record.
4) If Type=MX, Value is the canonical name of a mail-server that has an alias hostname Name.
1) Header Section
i) Identification
This identifier allows the client to match received replies with sent queries.
ii) Flag
a) Query/Reply
¤ This flag-bit indicates whether the message is a query (0) or a reply (1).
b) Authoritative
c) Recursion Desired
¤ This flag-bit is set when a client desires that the DNS server perform recursion.
These fields indicate the no. of occurrences of 4 types of data sections that follow the header.
2) Question Section
• This section contains information about the query that is being made.
i) Name
ii) Type
This field indicates the type of question being asked about the domain-name.
3) Answer Section
• This section contains the resource-records for the name that was originally queried.
• A reply can return multiple RRs in the answer, since a hostname can have multiple IP
addresses.
4) Authority Section
5) Additional Section