32
Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03 Jeff Miller

Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Embed Size (px)

Citation preview

Page 1: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Networking and Communication:Bus, switch, and network structures and protocols, I/O, Synchronization

Ray Tsai, Shui wing YimCS490 (Fall 2003)10/20/03Jeff Miller

Page 2: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Networking Basic

Network - A network is a group of computers connected together in a way that allows information to be exchanged between the computers.

Node - A node is anything that is connected to the network. While a node is typically a computer, it can also be something like a printer or CD-ROM tower.

Segment - A segment is any portion of a network that is separated, by a switch, bridge or router, from other parts of the network.

Page 3: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Topology - Topology is the way that each node is physically connected to the network. Common topologies include:

BUSRINGSTAR

Page 4: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Bus - Each node is daisy-chained (connected one right after the other) along the same backbone. Information sent from a node travels along the backbone until it reaches its destination node. Each end of a bus network must be terminated with a resistor to keep the signal that is sent by a node across the network from bouncing back when it reaches the end of the cable.

Page 5: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Bus

Page 6: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Ring - Like a bus network, rings have the nodes daisy-chained. The difference is that the end of the network comes back around to the first node, creating a complete circuit. In a ring network, each node takes a turn sending and receiving information through the use of a token. The token, along with any data, is sent from the first node to the second node, which extracts the data addressed to it and adds any data it wishes to send.

Page 7: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Ring

Page 8: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Star - In a star network, each node is connected to a central device called a hub. The hub takes a signal that comes from any node and passes it along to all the other nodes in the network. A hub does not perform any type of filtering or routing of the data. It is simply a junction that joins all the different nodes together.

Page 9: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Start

Page 10: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Network Structure

There are two common types of home networks: peer-to-peer and client/server.

Client/server networks have a centralized administrative system that provides information to all of the other devices.

Peer-to-peer means that each device can talk directly to each other device on the network without consulting a central system first. The first computer that you install the software on becomes the Application Server.

Page 11: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Clients and ServersIn general, all of the machines on the Internet can be categorized as two types: servers and clients. Those machines that provide services (like Web servers or FTP servers) to other machines are servers. And the machines that are used to connect to those services are clients. When you connect to Yahoo! at www.yahoo.com to read a page, Yahoo! is providing a machine (probably a cluster of very large machines), for use on the Internet, to service your request. Yahoo! is providing a server. Your machine, on the other hand, is probably providing no services to anyone else on the Internet.

Page 12: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Switch

Switches are a fundamental part of most networks. They make it possible for several users to send information over a network at the same time without slowing each other down. Switches allow different nodes (a network connection point, typically a computer) of a network to communicate directly with one another in a smooth and efficient manner.

Page 13: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03
Page 14: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Switches usually work at Layer 2 (Data or Datalink) of the OSI Reference Model, using MAC addresses, while routers work at Layer 3 (Network) with Layer 3 addresses (IP, IPX or Appletalk, depending on which Layer3 protocols are being used). The algorithm that switches use to decide how to forward packets is different from the algorithms used by routers to forward packets.

Page 15: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Packet-based switches use one of three methods for routing traffic:

Cut-through Store-and-forward Fragment-free

Cut-through switches read the MAC address as soon as a packet is detected by the switch. After storing the 6 bytes that make up the address information, they immediately begin sending the packet to the destination node, even as the rest of the packet is coming into the switch.

Page 16: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03
Page 17: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

In above example, if either switch A or C fails, then the nodes connected to that particular switch are affected, but nodes at the other two switches can still communicate. However, if switch B fails, then the entire network is brought down. What if we add another segment to our network connecting switches A and C?

Page 18: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03
Page 19: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

In this case, even if one of the switches fails, the network will continue. This provides redundancy, effectively eliminating the single point of failure.

But now we have a new problem. In the last section, you discovered how switches learn where the nodes are located. With all of the switches now connected in a loop, a packet from a node could quite possibly come to a switch from two different segments. For example, imagine that Node B is connected to Switch A, and needs to communicate with Node A on Segment B. Switch A does not know who Node A is, so it floods the packet.

Page 20: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03
Page 21: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

The packet travels via Segment A or Segment C to the other two switches (B and C). Switch B will add Node B to the lookup table it maintains for Segment A, while Switch C will add it to the lookup table for Segment C. If neither switch has learned the address for Node A yet, they will flood Segment B looking for Node A. Each switch will take the packet sent by the other switch and flood it back out again immediately, since they still don't know who Node A is. Switch A will receive the packet from each segment and flood it back out on the other segment. This causes a broadcast storm as the packets are broadcast, received and rebroadcast by each switch, resulting in potentially severe network congestion.

Page 22: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

IP AddressesTo keep all of these machines straight, each machine on the Internet is assigned a unique address called an IP address. IP stands for Internet protocol, and these addresses are 32-bit numbers, normally expressed as four "octets" in a "dotted decimal number." A typical IP address looks like this:

216.27.61.137 The four numbers in an IP address are called octets because they can have values between 0 and 255, which is 28 possibilities per octet.

Page 23: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

ProtocolsOnce a client has connected to a service on a particular port, it accesses the service using a specific protocol. The protocol is the pre-defined way that someone who wants to use a service talks with that service. The "someone" could be a person, but more often it is a computer program like a Web browser. Protocols are often text, and simply describe how the client and server will have their conversation.

Page 24: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Perhaps the simplest protocol is the daytime protocol. If you connect to port 13 on a machine that supports a daytime server, the server will send you its impression of the current date and time and then close the connection. The protocol is, "If you connect to me, I will send you the date and time and then disconnect." Most UNIX machines support this server. If you would like to try it out, you can connect to one with the Telnet application. In UNIX, the session would look like this:

Page 25: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

%telnet web67.ntx.net 13 Trying 216.27.61.137... Connected to web67.ntx.net. Escape character is '^]'. Sun Oct 25 08:34:06 1998 Connection closed by foreign host.

Page 26: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Five Classic Components of a Computer

Processor

1. Control2. Datapath Memory

Input

Output

Page 27: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Why have I/O?

Interactive Applications Long Term Storage Swap for Virtual Memory Different types of devices(different

performance) Hide differences between devices Sharing of devices among different

applications

Page 28: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

I/O Devices

Provide input and output to a computer’s processor (AKA: peripherals)

Measuring Performance: response time vs. throughput (data rate)

Examples:

Device Function Data rate (KB/sec)

Keyboard/Mouse Input .01/.02

Video Card/Printer Output 60000/200

Modem/LAN Card Input+Output 8/500-6000

Optical/Magnetic Disk

Storage 2000-10000

Page 29: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Magnetic Disks

Nonvolatile storage Slower, but less expensive level of

memory hierarchy Access Time = seek time + rotational

latency + transfer time + overhead Average rotation delay = 0.5/RPM

Page 30: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Communication between processor/memory and I/O devices Buses – PCI, SCSI Interface

1. Memory mapped I/O – Single Bus for memory and I/O2. Separate I/O Bus, separate I/O Instructions

Device Controllers – deal with control of the I/O device, hides complexity from processor, processor communicates with controller

I/O Control – Polling (simple, uses processor time) vs. Interrupts

Data Movement1. Programmed I/O – processor touches the data (uses up processor time)2. DMA – processor sets up transfer, DMA controller transfers data (complicates memory system)

Page 31: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

Synchronization

Definition – process of coordinating the behavior of two or more processes, which may be running on different processors

1) Locking - Semaphores 2) Message Passing

Page 32: Networking and Communication: Bus, switch, and network structures and protocols, I/O, Synchronization Ray Tsai, Shui wing Yim CS490 (Fall 2003) 10/20/03

References

Computer Organization & Design: The Hardware/Software Interface, Second Edition by Patterson and Hennessy. (Chapters 8-9)

http://computer.howstuffworks.comhttp://computer.howstuffworks.com