420 likes | 540 Views
L. =. 1. -. (. 1. -. P. ). (. 1. -. P. ). 2. 1. i. n. t. o. (. 6. A. ). (. p. r. o. v. e. f. o. r. e. c. ). D. (7). U. =. ´. (. 1. -. P. ). (. 1. -. P. ). ´. 1. 2. H. +. D. 1. +. CT. /. (. H. +. D. ). r. e. p. r. e. s. e. n.
E N D
L = 1 - ( 1 - P ) ( 1 - P ) 2 1 i n t o ( 6 A ) ( p r o v e f o r e c ) D (7) U = ´ ( 1 - P ) ( 1 - P ) ´ 1 2 H + D 1 + CT / ( H + D ) r e p r e s e n t s l o s s d u e t o t h e h e a d e r . ( 1 - P ) ( 1 - P ) r e p r e s e n t s l o s s d u e t o t h e e r r o r s 1 2 r e p r e s e n t s l o s s d u e t o t h e s t o p - a n d - w a i t T o p r o c e e d f u r t h e r w e n e e d t o m a k e m o r e a s s u m p t i o n s . 1 subst (2) D H + D 1 1 + CT / ( H + D )
H ( 1 - E ) H + D ( 1 - E ) • Assume that the prob. of a bit error is independent and that it is E. Assume that the size of the ACK is the same as the size of the header A=H. • Then channel utilization is: D 1 H + D H (8) U = ´ ( 1 - E ) ( 1 - E ) ´ H + D 1 + CT / ( H + D ) = prob of no errors for H=A bits in a row = prob of no errors for F=D+H bits in a row • To maximize the channel utilization, we need to • be given: header size (H), error rate (E), raw • bandwidth (C) and timeout interval (T).
ln ( 1 - E ) » - E ln ( 1 - 0 . 1 ) = - 0 . 105 H + CT é 4 ù D » 1 + - 1 (11) opt ê ú 2 ( H + CT ) E ë û ¶ U H + CT 2 (9) = 0 = D + D ( H + CT ) + ) ¶ D ln( 1 - E H + CT é 4 ù (10) D = 1 - 1 - opt ê ú 2 ( H + CT ) l ( 1 - E ) ë û For a small E , ,since D is an integer, we will round off at the end anyway. E.g., also, a small E means that both the 1 under the radical and the 1 following the radical can be ignored
D » ( H + CT ) / E opt (prove for ec) (12) (H+CT)=overhead from headers and timeouts. E.g., let H+CT=11, then plot D=f(E)
y 30 25 20 15 10 5 0 0.2 0.4 0.6 0.8 1 x • Here, x=E, as the line get better, D opt gets longer. • A high error rate lowers D to avoid the rexmission of long frames.
D D = xD ( 1 - E ) » 1 - ED opt » ( H + CT ) / E opt 1 - x ( H + CT ) E U » ( 1 - 2 HE ) 1 1 - ( H + CT ) E x Let and into D subst D 1 U = ´ ( 1 - E ) H + D ( 1 - E ) H ´ H + D 1 + CT / ( H + D ) You get xD 1 opt U = ´ ( 1 - EH - ExD ) ( 1 - EH ) ´ opt H + xD 1 + CT / ( H + xD ) opt opt prove (etc) (13)
Sample quiz question: • Frames of 1500 bits are send over a 2Mbps channel. Acks are piggybacked onto data frames, Headers are short and use 3 bit sequence numbers. Find the max U for stop-and-wait, protocol 5 and protocol 6.
I = t = one - way propagation delay Performance of the sliding window protocol • Assume that acks are piggybacked onto reverse traffic, so that the can be ignored. Assume that interrupt processing time is negligible so that interrupt and service time+prop. delay= • Assume that the channel is error-free (E=0)
W ³ 1 + 2 CI / F ( large window , no errors ) D U = H + D • Case 1: The window is big enough to allow acks to return before the window is full. Frame xmit time = F/C, W= window size so in WF/C seconds an ack should return. • 2I=time it takes to make a round trip so that F/C+2I= time it takes and ack to come back. So and U is limited by the size of the Header
WD D W U = = F + 2 CI H + D 1 + 2 CI / ( H + D ) • Case 2: The window is not big enough to allow acks to return before it is full. The sender must stop-and-wait for the first ack. It may then send one more frame, at which time the next ack arrives. Each cycle takes F/C+2I (which uses up F+2CI bits of bandwidth) and is carries WD data bits. Therefore: • if W< 1+2CI /F then (small window, no errors) • (prove for ec)
W ³ 1 + 2 CI / F ( large window , with errors ) D U = ´ ( 1 - L ) H + D • Case 3: Assume E°0 (i.e. there are errors) and that the window is big enough to allow continuous xmission (with dups for correction) = 1/(1-L), L=prob that a frame or ACK is lost. To get W frames w/o error, you expect to xmit W/(1-L) of them. • If
D W U = ´ ( 1 - L ) ´ H + D 1 + 2 CI / ( H + D ) • Case 4: E°0 and the window is small and so U drops by the retransmission factor (1-L). • If w<1+2CI /F (small window, with errors) • The length of a cable (in bits) is CI. • CI/F = cable length in frames. • Case boundary occurs if W=1+2IC/F. • F=H+D
1 (0.792)*(W)*(((1)+((2)*(frames)))^(-1)) • E.g. H=20, D= 80, W=1 (stop-and-wait), L=.01 and W=7 0.8 0.6 0.4 0.2 frames 0 2 4 6 8 10 0 • For a given window size, U is better for short cables.
Framing In order for the DLL to group bits into frames it uses the techniques of • character counting, • starting and ending characters, with character stuffing, • starting and ending flags, with bit stuffing
physical layer coding violations Character counting uses a field in the header to indicate the number of characters in a frame. Problem: xmission error changes the char count. A checksum error will not indicate where the next frame begins and so Character counting is not usually used.
Starting and ending characters with character stuffing is a framing method that gets around the resynchronization problem. Each frame starts with the ASCII DLE STX and ends with DLE ETX (DLE=Data Link Escape, STX= Start of text). The problem with this is that binary data may contain a DLE STX or ETX sequence in it. A solution is to send each DLE in the binary data twice. This is called character stuffing. The problem with character stuffing is that it is 8-bit ASCII code tied.
Bit stuffing allows n-bit per character. Each frame begins and ends with 01111110. If the data contains 5 1’s the sender stuffs in a 0 bit. E.g. 01111110->011111010. The receiver removes the 0 following 5 1’s.
• physical layer coding violations–This works when the physical layer uses redundancy in the coding (i.e. Manchester encodes a 1 as a high-low pair and a 0 as a low-high pair). Since high-high and low-low are not used for data they can be used for framing and so no stuffing is needed. This is a part of the 802 standard (Ethernet). Many data link protocols use some combination of physical layer coding, counting, character and bit stuffing.
Summary Layer 2 (DLL) is also known as MAC (media access control) layer. Bridges are devices which join LANs at the MAC layer. • Bridges treat all packets in the same way, regardless of networking protocol. • Bridges can connect local and remote LANs • Bridges can connect LANs of different types (ether to FIDDI bridge)
There are 3 kinds of bridges in the world: transparent, spanning tree and source routing. • Transparent – copies all MAC frames • Spanning tree – Uses a broadcast/discovery process to determine the path a packet must take to reach a destination LAN • Source routing bridges – allow packets to take different paths across an internetwork.
Transparent bridges cannot be used if there are multiple paths to a subnet...loops mean dups! • Spanning tree bridges can work on mesh nets since they compute the path (using the spanning tree algorithm) by broadcasting messages to one another. Spanning tree disables any bridge which provides a redundant path in an internetwork. These bridges are activated if a path fails.
Source routing bridges - “poor man’s routing” - routing is static, once the path info is set, a packet will not take an alternative route.
• If a link fails, the packet does not get through. • The packet header has the path encoded into it. As each packet traverses an internetwork, it stores info about the path it is taking (bridge and LAN). The info is used to route later packets. • Typically used in token ring nets.
The Network Layer Layer 3 (network layer) is where the routers operate. internetworking-Connection of multiple network together • Routers can distinguish between protocols • Routers can filter packets by protocol type. • Routers can perform dynamic switching. Dynamic switching -> compute the best path=f(traffic)
Routers use router protocols: • RIP (routing information protocol) • OSPF (open shortest path first) • IGRP (interior gateway routing protocol) • IS-IS (intermediate system to intermediate system) • Each router-to-router protocoldetermines the best path differently. • Access routers are internetworking devices. A few WAN ports (leased line, auto dial-up or microwave or...) link remote LAN’s.
Lots of router companies around, Ascom Timeplex, Coral Network corp, Crosscomm corp, proteon Inc, Retix, Cisco... Each offer routers with different features (throughput, hot-swappable components, redundant power supplies, redundant cooling fans, various protocol recognition etc.). •Router throughput is measured in packets per second • typically 150k pps or higher is needed (for high end stuff)
Network Layer Design Issues • service provided to the transport layer • routing of packets • congestion control • internetworking
Services Provided to the Transport Layer Some services (ARPANET, X.25 etc..) the network layer runs in the IMPs and the transport layer runs in the hosts. There is controversy regarding what services are provided. There is agreement about the following: • services should be independent of the subnet technology • The transport layer should be shielded from the number, type and topology of the subnets present
• The network addresses made available tot he transport layer should use a uniform numbering plan, even across LANs and WANs. Controversy: connectionless service vs. connection oriented post office vs. telephones ARPA Internet community (20 years experience) says that the subnet is unreliable -> hosts do error and flow control and connectionless service is provided. Each packet must carry the full destination address.
Carriers say that the network layer and subnet should be reliable, connection-oriented serivce with the features: • set-up a connection (dial-ring-ans-talk-hangup) • negotiation about service parameters (quality, speed, cost) • Error and flow control • correct sequencing • charge for connect time!
Multimedia requires connection oriented services, letters do not. Some applications may require lossy transforms to obtain on-time arrival (not permitted in other applications). • Connection-orientation becomes a part of the network infrastructure, it is expensive. Can we trust the carriers to provide reliability?
Design by Committee: OSI took a vote, connection-oriented supporters won then ISO modifies the OSI model so that both services are available (make everybody happy). • The same issue arises in all layers. The fight was resolved using the same technique as before, every layer from network up can be either connection oriented or not.
At the top of each layer (except for the application layer) are SAPs (service access points). The SAP enables the layer above to access the service. Each SAP has its own address.
The OSI Network Service Primitives • International Standard 8348 provides connectionless primitives and connection oriented primitives. • There are 4 kinds of OSI connection-oriented primitives: • establishing, releasing, using and resetting connections.
establishing N-connect.request sets up a connection using the NSAP (network service access point, net address). It provides for option negotiation • acks_wanted, • expedited data (allowing the user to break a stream), • quality of service • throughput • delay • error rate • secrecy • cost and more!!
releasing • N-disconnect.request , N-disconnect.indication • N-DISCONNECT.request rejects it (reason field)
using N-data.request(user_data) N-data.indication(user_data) • responds to an N-data.request arrival N-data-acknowledge.request() • if ack has been agreed upon, this will send an ack N-data-acknowledge.indication() • responds to an N-data.acknowledge arrival (acks the ack)
acks are counted and unlabeled, the error control is usually in other layers anyway. N-Expedited-data.request(user_data) N-expedited-data.indication(user_data) • responds to an N-data.expedited arrival
resetting N-reset.request(originator,reason) reports catastrophes (crashes of trasport layer, service provided ..) The transport layer must recover from N-resets (all queues are erased). N-reset.indication(originator,reason) • responds to an N-data.reset arrival The basic data unit is 64,512 bytes long (2**16 -1k) the 1K is used for overhead. N-reset.response() N-reset.confirm()
Internal Organization of the Network Layer OSI model does not provide a spec of the algorithm for • routing • congestion control virtual circuit - like the telephone, connection oriented datagrams - like telegrams, connectionless
virtual circuits are used in subnets with a connection-oriented goal. When a connection is released, the virtual curcuit is discarded. For each VC the IMP must remember where to forward the packets and use a table to keep track. Each packet has a VC number field in the header. VC numbers must be unique. • datagrams have no routes set in advance (unlike VC). Each packet is routed independently. This is more robust in the presents of failure and congestion.
A D H H • For a VC a unique number assignment can be a problem. for example: B H H E F C H H How do we get from A to D? ABCD, ABCEFD, ABFD,ABECD