ICOM 6115 Computer Networks and the WWW Manuel

  • Slides: 24
Download presentation
ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph. D. Lecture 7

ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph. D. Lecture 7 ICOM 6115 ©Manuel Rodriguez-Martinez

Lecture Objectives • Understand Network Performance Characterization – Buffering – Bandwidth – Delay x

Lecture Objectives • Understand Network Performance Characterization – Buffering – Bandwidth – Delay x Bandwidth – Signal Encoding ICOM 6115 ©Manuel Rodriguez-Martinez

Buffering I/O Streams • I/O operations are time consuming – CPU interrupts, memory copies,

Buffering I/O Streams • I/O operations are time consuming – CPU interrupts, memory copies, etc • Thus, each I/O should read/write as much as possible – Read block of bytes, then sort out integers, string, and other object from the block • You should make buffered I/O streams with your sockets • Typical buffer sizes (in bytes) are – 512, 1024, 4096 ICOM 6115 ©Manuel Rodriguez-Martinez

Example of buffering in Java Object. Input. Stream data_in = null; Socket cli_sock =

Example of buffering in Java Object. Input. Stream data_in = null; Socket cli_sock = null; short msg = 0; // connect the socket data_in = new Object. Input. Stream (new Buffered. Inputstream(cli_sock. get. Input. Stream(), 4096); short value = data_in. read. Short(); • Data_in will try to read up to 4096 – OS will likely bring in chunks of 512 or 1024 bytes specially from network • Integers, string, and other objects will be decoded from the bytes stored in this block ICOM 6115 ©Manuel Rodriguez-Martinez

Serialization and Deserialization • Typically applications deal with object, integers, string, etc. – These

Serialization and Deserialization • Typically applications deal with object, integers, string, etc. – These must be converted into bytes, then bits • Serialization – Process of converting high level data types into bytes and then sending over the network • Deserialization – Process of reconstructing high level data types from bytes received from the network ICOM 6115 ©Manuel Rodriguez-Martinez

Example of Serialization and Deserialization //Sender: data_out. write. Short(0); data_out. write. Int(100); data_out. write.

Example of Serialization and Deserialization //Sender: data_out. write. Short(0); data_out. write. Int(100); data_out. write. Object(“Dude!”); //Receiver: val 1 = data_in. read. Short(); val 2 = data_in. read. Int(); val 3 = (String) data_in. read. Object(); • Sender and receiver must agree on order of exchange and types exchanged – Otherwise serialization will fail ICOM 6115 ©Manuel Rodriguez-Martinez

Network Bandwidth • Bandwidth – Number of bits transmitted per second • Rate measured

Network Bandwidth • Bandwidth – Number of bits transmitted per second • Rate measured in bits per second – Ex. Ethernet at 10 Mbps • Each bit as a given width, which is how long it takes to transmit the bit – 10 Mbps is 10 x 1, 000 bits/sec • 1 bit lasts 1 microsecond ICOM 6115 ©Manuel Rodriguez-Martinez

Bandwidth • Bandwidth measures capacity to move amounts of bits per unit of time

Bandwidth • Bandwidth measures capacity to move amounts of bits per unit of time • Bandwidth is not the speed at which bits move – Depends on transmission medium ICOM 6115 ©Manuel Rodriguez-Martinez

Bandwidth and frequency • Bandwidth can be increased for a given link by increasing

Bandwidth and frequency • Bandwidth can be increased for a given link by increasing the frequency at which bits are sent – Bits are made shorter! – Ex: • 1 Mbps – each bit is 1 microsecond wide • 2 Mbps – each bit is 0. 5 microseconds wide • 10 Mbps – each bit is 0. 1 microseconds wide ICOM 6115 ©Manuel Rodriguez-Martinez

Bandwidth and bit width Voltage 1 8 bits/sec 1 1 1 0 0 Voltage

Bandwidth and bit width Voltage 1 8 bits/sec 1 1 1 0 0 Voltage 1 sec 0 1 1 0 0 1 1 1 0 0 0 16 bits/sec Higher bandwidth means more bits per unit of time ICOM 6115 ©Manuel Rodriguez-Martinez

Issues at higher bandwidth • By increasing the number bits it becomes more complex

Issues at higher bandwidth • By increasing the number bits it becomes more complex to detect where each one ends and begins • Need to have good media – Minimize distortion of the signal due • Attenuation – loss of power as function of time • Noise – mostly thermal noise due to agitation of electrons on the medium – causes extra signal components added to original signal ICOM 6115 ©Manuel Rodriguez-Martinez

Network Latency • Latency – how long it takes a bit to travel from

Network Latency • Latency – how long it takes a bit to travel from one end of the link to another – Measure in terms of time – Ex. Transcontinental delay of fiber link is 24 milliseconds • Round-trip-time (RTT) – time for a bit to reach one end of the network and return back – 2 X latency of network ICOM 6115 ©Manuel Rodriguez-Martinez

Network Latency and RTT One way latency Sender ICOM 6115 Receiver RTT Receiver ©Manuel

Network Latency and RTT One way latency Sender ICOM 6115 Receiver RTT Receiver ©Manuel Rodriguez-Martinez

Network Latency (aka Delay) • There are three major components for latency – Propagation

Network Latency (aka Delay) • There are three major components for latency – Propagation delay – time for bit to move over wire, fiber or air – Transmit time – time to put bits on the wire – Queuing Time – time spent by message store in queues at routers/switches ICOM 6115 ©Manuel Rodriguez-Martinez

Components of Network Latency • Latency = Propagation + Transmit + Queue • Propagation

Components of Network Latency • Latency = Propagation + Transmit + Queue • Propagation = Distance / Effective Speed of Light on medium • Transmit = Packet Size / Bandwidth • Queue = average time for packets at queue on router/switch before getting forwarded ICOM 6115 ©Manuel Rodriguez-Martinez

Question • Calculate the total time required to transfer a 1000 MB file if

Question • Calculate the total time required to transfer a 1000 MB file if the network has a RTT of 100 ms, packet size of 1 KB of data, bandwidth of 1. 5 Mpbs and no routers, and packets can be send continuously. • Answer: ICOM 6115 ©Manuel Rodriguez-Martinez

Questions • Suppose we have a 1000 Mpbs channel? – How long are the

Questions • Suppose we have a 1000 Mpbs channel? – How long are the bits? – Answer: 1 nanosecond • Consider a 10 Mbps with a – Answer: ICOM 6115 ©Manuel Rodriguez-Martinez

Delay x Bandwidth product • Consider a network link as a hollow pipe –

Delay x Bandwidth product • Consider a network link as a hollow pipe – To move bits from host A to host B • Bandwidth – Diameter of the pipe • Delay – Length of pipe (time for 1 bit to travel it) • Delay x Bandwidth products – Number of bits that can be fit into the pipe during 1 latency ICOM 6115 ©Manuel Rodriguez-Martinez

Delay x Bandwidth Product Bandwidth Delay • Delay x bandwidth gives the bit volume

Delay x Bandwidth Product Bandwidth Delay • Delay x bandwidth gives the bit volume of the pipe ICOM 6115 ©Manuel Rodriguez-Martinez

Why is this important? • Network must be used efficiently • Sending one bit

Why is this important? • Network must be used efficiently • Sending one bit at a time is out of the question! – Need to send groups of bits • Frames • Delay x bandwidth products tells us how many bits we can send to fill the pipe – If we get to transmit try to fill the pipe ICOM 6115 ©Manuel Rodriguez-Martinez

RTT and Delay x Bandwidth • RTT is 2 x delay • In 1

RTT and Delay x Bandwidth • RTT is 2 x delay • In 1 delay we can send delay x bandwidth bits • If sender expects a reply from receiver it will take a another delay for those bits to arrive • We can send another pack of bits just after the reply arrives – We can send 2 delay x bandwidth worth bits before processing the first acknowledgement ICOM 6115 ©Manuel Rodriguez-Martinez

Bandwidth versus Latency • Relative importance – 1 -byte: 1 ms vs 100 ms

Bandwidth versus Latency • Relative importance – 1 -byte: 1 ms vs 100 ms dominates 1 Mbps vs 100 Mbps – 25 MB: 1 Mbps vs 100 Mbps dominates 1 ms vs 100 ms • Infinite bandwidth – RTT dominates • Throughput = Transfer. Size / Transfer. Time • Transfer. Time = RTT + 1/Bandwidth x Transfer. Size • 1 -MB file to 1 -Gbps link as 1 -KB packet to 1 -Mbps link ICOM 6115 ©Manuel Rodriguez-Martinez

Question • Suppose we have a 1 KM copper wire, with a propagation delay

Question • Suppose we have a 1 KM copper wire, with a propagation delay of 200 ms and 10 Mbps bandwidth – How many bits can we fit on the wire? ICOM 6115 ©Manuel Rodriguez-Martinez

Signal Endocing ICOM 6115 ©Manuel Rodriguez-Martinez

Signal Endocing ICOM 6115 ©Manuel Rodriguez-Martinez