csit 220 (blum) 1 flow control and tcp/ip based on computer networks and internets, comer

58
CSIT 220 (Blum) 1 Flow control and TCP/IP Based on Computer Networks and Internets, Comer

Upload: josephine-ford

Post on 25-Dec-2015

221 views

Category:

Documents


2 download

TRANSCRIPT

CSIT 220 (Blum) 1

Flow control and TCP/IP

Based on Computer Networks and Internets, Comer

2CSIT 220 (Blum)

Flow control

In networking, “flow control” refers to adjusting the rate at which data is transmitted from a source so that it does not overwhelm the destination.

Flow control is especially important in cases when the source is faster than the destination.

3CSIT 220 (Blum)

An example

Imagine sending a large file from a computer to a printer. The computer can transmit much faster than the

printer can print; furthermore, the printer may be shared and have other print jobs.

The printer has a buffer but that buffer has a finite size.

A common flow-control mechanism in a case like this is xon-xoff.

4CSIT 220 (Blum)

Xon-xoff

In this case, the printer (destination) sends an xoff message to the computer (source) indicating that its buffer is full.

The computer (source) should then stop sending data.

When the printer’s buffer is free and it is ready to accept more data, the printer sends an xon signal.

Flow control can be implemented in hardware or software, or a combination of both.

5CSIT 220 (Blum)

Xon-Xoff

The actual signal for X/on is the same bit configuration as the ASCII Ctrl-Q keyboard combination. The X/off signal is the Ctrl-S character.

When you define your modem to your computer's operating system, you may need to specify the use of flow control with X/on/Xoff or with CTS/RTS (Clear to Send/Ready to Send). When sending binary data, Xon/Xoff may not be recognized because it is character-encoded.

6CSIT 220 (Blum)

ASCII XON and XOFF

Dec Oct Hex

7CSIT 220 (Blum)

Choke packet

A specialized packet that is used for flow control along a network.

A router detects congestion by measuring the percentage of buffers in use, line utilization and average queue lengths.

When it detects congestion, it sends choke packets across the network to all the data sources associated with the congestion. The sources respond by reducing the amount of data they are sending.

8CSIT 220 (Blum)

Balancing speed and accuracy

Increasing various individual speeds might not increase the speed of the network , particularly if it overloads the destination or some routing device along the way. This results in packets being dropped, requiring retransmission. And the overall result can be a reduction in speed.

Network administration can be a very delicate balancing act.

9CSIT 220 (Blum)

Congestion control and packet delivery If you slow down your transmission too

much, either the bandwidth is not being used or it is being used by others.

But if you send too many messages, you will cause congestion, and you are sending messages that will only have to be retransmitted anyway.

10CSIT 220 (Blum)

Protocol Techniques

Flow ControlRecall that a destination must acknowledge

the receipt of a packet (in particular its Transport Layer).

But acknowledgements add to the traffic. There are flow-control techniques (sliding

windows for example) specifying how one acknowledges and how often.

11CSIT 220 (Blum)

Congestion avoidance Some packets contain “traffic reports,”

they have information about the status of the traffic.

Based on the status, the network may inform senders.

The network will either adjust the transmission size, change the route or change a window size used for transmission.

12CSIT 220 (Blum)

Unrestricted Protocol Assumes the receiver has an unlimited capacity

to receive frames. Sender and receiver use primitive calls to send

and receive. Sender sends a frame. The arrival causes the

receiver to wake up and receive the frame. Receiver extracts the packet and passes it up the stack and then goes back into a wait state until the next frame arrives.

In the Unrestricted Protocol, the sender does not have to wait for acknowledgements to send more packets.

13CSIT 220 (Blum)

Stop and Go Protocol

Different from the Unrestricted Protocol in that each time the destination receives a packet, it replies with an acknowledgement.

Sender waits for the acknowledgement before sending another frame.

The acknowledgement from the receiver contains an error field structure called an ack. An ack of 0, means there is no error. An ack of 1 means the packet contained an error.

14CSIT 220 (Blum)

Fig. 16.7

Stop and go Sliding windows

15CSIT 220 (Blum)

Sliding Window Protocols Compromise between Unrestricted and Stop-

and-go. The source can send a number of packets

without waiting for acknowledgments, but that number is limited.

The number of unacknowledged frames that is allowed is called the “window.”

The size of the window is an important network flow-control parameter.

Go back to Fig. 16-7

16CSIT 220 (Blum)

Windowing

17CSIT 220 (Blum)

Sliding Window Protocols

There are variations within a windowing protocol.Go-back-n: packets must be received in the

order they were transmitted. Receiver rejects any packet other than “the next one.”

Selective repeat: packets can arrive out of order, the receiver holds them and orders them before passing them to higher layer.

18CSIT 220 (Blum)

Comparing Protocols

In Go-Back-N, if the timer set by sender expires without an acknowledgement, the protocol resends every outstanding frame in the window.

In Selective Repeat, if timer expires only one packet must be sent. Allows for out-of-order packets. But requires more work on receiver’s part.

19CSIT 220 (Blum)

Window announcements

Like Xon/Xoff, Window "announcements" are messages sent by the receiving system to the transmitting system.

They acknowledge data receipt but also inform the transmitting system of the current buffer size. “I got your message and I only have X

amount of space if you’re sending me more.”

20CSIT 220 (Blum)

Piggyback

If the computers are having a two-way conversation, then a computer can send an acknowledge that it received information along with information of its own.

This technique is called piggybacking.

21CSIT 220 (Blum)

Bottleneck A bottleneck is the slow part of a process – in this

case where packets tend to accumulate. Bottlenecks affect network performance by slowing

down the flow of information transmitted across networks.

TCP/IP connections were originally designed to transmit only text files, and the proliferation of bandwidth-intensive transmissions such as high-resolution graphics has caused bottlenecks in the process; therefore, the data moves more slowly across networks.

22CSIT 220 (Blum)

Various needs No one network technology satisfies the

needs of all the users. Some connect nearby computers (LAN) Some connect more distant computers (WAN) Some exchange data files (best with large packets

over connectionless) Some convey real-time video (best with small

packets over connection-oriented system) Some users have millions of dollars to spend Some users have a very limited budget

23CSIT 220 (Blum)

Various Network Technologies Technologies emerged to fill these network niches. But as “connectivity” grew in importance, one

needed the ability not only to connect computers into a network, but also to connect networks into an internet.

The networks can differ immensely (heterogeneity) at the lowest level, but there must be some overlying logic (software/protocol) providing the homogeneity required for communication – we all must follow the same set of rules.

24CSIT 220 (Blum)

Universal Service

The goal of joining the various underlying networks and having them work together as if they were one uniform system is called “universal service.”

With Universal Service, a user at one computer in any part of the organization can exchange information with any other user without changing computers.

25CSIT 220 (Blum)

Heterogeneous Connections Since specific information about the

transmission lines and other hardware are needed at the Physical Layer and specific information about the LAN protocol are need at the Data-Link Layer (Ethernet, FDDI, ATM, etc.), the homogenizing cannot occur until Layer 3 in the OSI model. You cannot use bridges (Layer 2) to connect

heterogeneous networks, but you can use routers (Layer 3).

26CSIT 220 (Blum)

Routers

Routers forward packets from a source on one network to a destination on another.

A router can connect different types of networks: LAN-LAN, LAN-WAN, WAN-WAN.

A router can connect networks using different protocols: e.g. Ethernet LAN to FDDI LAN.

If the frame formats and addressing schemes differ on the networks connected by a router, then software is needed to make this transition possible.

27CSIT 220 (Blum)

Virtual Network A homogeneous high-level (Internet) software

gives the illusion of a homogenous network, which at the lowest levels can be quite heterogeneous. The logically homogenous network is sometimes called a “virtual network.” Here think of virtual as meaning software.

This is a version of information hiding: each layer hides the details of its implementation. Only the interface with adjacent layers is exposed. Thus, the details of physical network connections, physical address, and so on are hidden from higher layers.

28CSIT 220 (Blum)

clouds

A similar notion is that of a “network cloud.” One loses sight of information as it enters the cloud.

Especially in a connectionless scheme, the message enters the network and takes an unknown path to its destination. Furthermore, packets from the same message may take different paths.

If the underlying network is heterogeneous, the packets may be translated into other protocol formats.

But when the message re-emerges from the cloud, it appears to be the same message that entered the cloud.

29CSIT 220 (Blum)

30CSIT 220 (Blum)

Internet Protocols

TCP/IP is the most widely used internet communication protocol suite (stack).

Originally the TCP/IP protocol suite was designed to create a standard set of procedures allowing individual computer networks to connect to ARPANET.

Today it is used to connect computers to the Internet (with a capital I). Small i: two or more networks connected, capital I: the

global connection of networks.

31CSIT 220 (Blum)

TCP/IP

Transmission

Control

Protocol

Internet

Protocol

32CSIT 220 (Blum)

Layering again

The TCP/IP is a reference model for internet communication.

Like the OSI model, it comes in layers. One difference is that it has fewer layers. The biggest difference is that TCP/IP is

widely implemented, whereas OSI has become a “taxonomy” for discussing a network but not a way of implementing one.

33CSIT 220 (Blum)

TCP/IP History The early work on TCP/IP was done in the

1970’s much of it for ARPA (Advanced Research Projects Agency).

The formal standards are laid out in IETF RFC 791 and RFC 793. IETF Internet Engineering Task Force RFC Request For Comments

TCP/IP gained its dominance in internet protocols when it was included with a version of the Unix operating system.

34CSIT 220 (Blum)

IP Standards (RFC 791)

35CSIT 220 (Blum)

TCP Standards (RFC 793)

36CSIT 220 (Blum)

Layers The Internet Layering Model (TCP/IP)

has 4 or 5 layers depending on whom you ask, the layers are:ApplicationTransport InternetNetwork Interface(Physical) there must be a physical layer,

but it was not part of the original model

37CSIT 220 (Blum)

Correspondence The lowest layers of the TCP/IP are pretty

much equivalent to the lowest layers of the OSI model.

TCP/IP’s transport layer is somewhat “thicker” (has more functions) than that in the OSI model.

The most notable difference is in the upper layers, TCP/IP has one layer roughly corresponding to OSI’s top three layers.

38CSIT 220 (Blum)

CorrespondenceOSI Model TCP/IP Model

Application

ApplicationPresentation

SessionTransportTransport

Network Internet

Data Link Network Interface

Physical (Hardware)

TCP/IP’s transport layer is somewhat thicker – has more functions than OSI’s.

39CSIT 220 (Blum)

TCP/IP Layers (Physical)

corresponds to OSI Layer 1 Network Layer

specifies how to organize data into frames and how to transmit the frames over a network. (Data Link Layer)

Internet specifies the format of the packets sent across an

internet as well as forwarding. (Network Layer) Transport

ensures reliable transfer (Transport Layer, some Session)

Application specifies how an application uses the internet (Rest

of Session, Presentation and Application)

40CSIT 220 (Blum)

TCP/IP TCP/IP is named after two parts of the protocol

stack: TCP (from the Transport Layer) and IP (from the Internet Layer).

TCP/IP (Transmission Control Protocol/Internet Protocol) is the basic communication language or protocol of the Internet.

TCP/IP communication is primarily point-to-point, meaning each communication is from one point (or host computer) in the network to another point or host computer.

41CSIT 220 (Blum)

TCP Transmission Control Protocol manages the

fragmenting of a message or file into smaller packets that are transmitted over the Internet and received by a TCP layer that reassembles the packets into the original message.

TCP is responsible for the verification that files were sent and received.

It makes the connectionless scheme that lies underneath logically connection-oriented. Session verification not constant data rate.

42CSIT 220 (Blum)

TCP Example

When an HTML file is sent to you from a Web server, the TCP in that server breaks the file into one or more packets, numbers the packets, and then forwards each of them to the IP layer.

At the other end (the client program in your computer), TCP reassembles the packets and waits until they have arrived to forward them to you as a single file.

43CSIT 220 (Blum)

IP Internet Protocol handles the adding

addresses (IP addresses) to the packets and routing them, that is, IP’s job is to get the packets where they’re going.

The IP layer is connectionless (sometimes also known as “stateless”), different packets may travel differ routes, and if a packet is dropped, it’s dropped.

44CSIT 220 (Blum)

Delivering the packet

Each packet is sent first to a gateway computer (router) that understands a small portion of the Internet.

The router reads the destination IP address and forwards the packet to a neighboring router.

It repeats the process until one router recognizes the packet as belonging to a computer within its immediate neighborhood or domain.

That gateway then forwards the packet directly to the computer whose address is specified.

45CSIT 220 (Blum)

Versions The most commonly used version of IP today is

Internet Protocol Version 4 (IPv4). However, IP Version 6 (IPv6) is also beginning to be

supported. IPv6 provides for much longer addresses (128 bits) and therefore for the possibility of many more Internet users.

IPv6 includes the capabilities of IPv4 and any server that can support IPv6 packets can also support IPv4 packets (backward compatibility).

46CSIT 220 (Blum)

More on the model TCP/IP uses the client/server model of

communication a computer user (a client) requests and is

provided a service (such as sending a Web page) by another computer (a server) in the network.

The other standard relationships are master/slave (one program in charge of all other programs) and peer-to-peer (either of two programs is able to initiate a transaction).

47CSIT 220 (Blum)

Client Server Example To check your bank account from your computer,

a client program in your computer forwards your request to a server program at the bank.

That program may in turn forward the request to its own client program that sends a request to a database server at another bank computer to retrieve your account balance.

The balance is returned back to the bank data client, which in turn serves it back to the client in your personal computer, which displays the information for you.

48CSIT 220 (Blum)

Daemon

In the usual client/server model, a program on the server, sometimes called a daemon, is activated and awaits client requests.

A daemon (pronounced DEE-muhn) runs continuously and its job is to handle service requests.

The daemon’s job is to receive the request, not perform the service. It usually forwards the request to the appropriate program.

49CSIT 220 (Blum)

Daemon Example

Each server of pages on the Web has an HTTPD or Hypertext Transfer Protocol daemon that continually waits for requests to come in from Web clients.

Your Web browser is a client program that requests services (the sending of Web pages or files) from a Web server (which technically is called a Hypertext Transport Protocol or HTTP server) in another computer somewhere on the Internet.

50CSIT 220 (Blum)

Application services

The services users are familiar with are in the application layers. These include Hypertext Transfer Protocol (HTTP) for transmitted web-

page documents. File Transfer Protocol (FTP) for transmitting other files. Telnet which allows one to log on to a computer

remotely. Simple Mail Transfer Protocol (SMTP) for email.

These and other protocols are packaged together with TCP/IP as a "suite."

51CSIT 220 (Blum)

UDP User Datagram Protocol Like TCP sits on top of IP in the TCP/IP model. Unlike TCP it is connectionless. UDP/IP provides very few error recovery services,

offering instead a direct (faster) way to send and receive datagrams over an IP network.

It's used primarily for broadcasting messages over a network.

52CSIT 220 (Blum)

Some other protocols

Other protocols are used by network host computers for exchanging router information. These include Internet Control Message Protocol (ICMP) Interior Gateway Protocol (IGP)Exterior Gateway Protocol (EGP)Border Gateway Protocol (BGP).

(We’ll talk about these another time.)

53CSIT 220 (Blum)

Intranet

Businesses liked the services (HTTP, FTP, SMTP, telnet, etc.) offered by the TCP/IP model but they did not necessarily want to be connected to the Internet, so they started setting up intranets.

An intranet is a set-up like the Internet (having browsers, email, etc.) but not connected to the outside world.

54CSIT 220 (Blum)

Intranet (cont.) With “tunneling”, companies can send private

messages through the public network, using the public network with special encryption/decryption and other security safeguards to connect one part of their intranet to another.

Allows a public transmission line to be used as part of a private network.

If a public line is used as part of a private network, that network is called a Virtual Private Network

55CSIT 220 (Blum)

Intranet (Cont.)

Typically, larger enterprises allow users within their intranet to access the public Internet through firewall servers that have the ability to screen messages in both directions so that company security is maintained.

When part of an intranet is made accessible to customers, partners, suppliers, or others outside the company, that part becomes part of an extranet.

56CSIT 220 (Blum)

Extranet

A private network that uses TCP/IP and the public telecommunication system to securely share part of a business's information with suppliers, vendors, customers, etc.

The required security and privacy are gained by using firewall server management, the issuance and use of digital certificates or other means of user authentication, encryption of messages, and the use of virtual private networks (VPN) that tunnel through the public network.

57CSIT 220 (Blum)

Tunneling

Tunneling works by adding another protocol, such as Microsoft’s Point-to-Point Tunneling Protocol (PPTP) or Cisco’s or Layer Two Forwarding (L2F).

This new protocol is embedded in the TCP/IP packets.

This allows organizations to use the Internet to transmit data across a virtual private network (VPN).

58CSIT 220 (Blum)

Other References

http://www.whatis.com http://www.webopedia.com TCP/IP Networking (James Martin and Joe

Leben) MCSE TCP/IP for Dummies, Cameron

Brandon