Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 7."— Presentation transcript:

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

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

3 ICOM 6115©Manuel Rodriguez-Martinez 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

4 ICOM 6115©Manuel Rodriguez-Martinez Example of buffering in Java 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 ObjectInputStream data_in = null; Socket cli_sock = null; short msg = 0; // connect the socket data_in = new ObjectInputStream (new BufferedInputstream(cli_sock.getInputStream(), 4096); short value = data_in.readShort();

5 ICOM 6115©Manuel Rodriguez-Martinez 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

6 ICOM 6115©Manuel Rodriguez-Martinez Example of Serialization and Deserialization Sender and receiver must agree on order of exchange and types exchanged –Otherwise serialization will fail //Sender: data_out.writeShort(0); data_out.writeInt(100); data_out.writeObject(“Dude!”); //Receiver: val1 = data_in.readShort(); val2 = data_in.readInt(); val3 = (String) data_in.readObject();

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

8 ICOM 6115©Manuel Rodriguez-Martinez 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 Bandwidth

9 ICOM 6115©Manuel Rodriguez-Martinez 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: 1Mbps – each bit is 1microsecond wide 2Mbps – each bit is 0.5 microseconds wide 10Mbps – each bit is 0.1 microseconds wide

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

11 ICOM 6115©Manuel Rodriguez-Martinez 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

12 ICOM 6115©Manuel Rodriguez-Martinez 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

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

14 ICOM 6115©Manuel Rodriguez-Martinez 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

15 ICOM 6115©Manuel Rodriguez-Martinez 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

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

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

18 ICOM 6115©Manuel Rodriguez-Martinez 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

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

20 ICOM 6115©Manuel Rodriguez-Martinez 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

21 ICOM 6115©Manuel Rodriguez-Martinez 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

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

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

24 ICOM 6115©Manuel Rodriguez-Martinez Signal Endocing


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

Similar presentations


Ads by Google