Computer Networks: Protocols - 1
본문 바로가기
TIL/ETC

Computer Networks: Protocols - 1

by koreashowme 2020. 10. 11.

Computer Networks: Computer Science

The first computer networks appeared in the 1950s and 60s

They were generally used within an organization - like a company or research lab to facilitate the exchange of information between different people and computers

This was faster and more reliable than the previous method of having someone walk a pile of punch cards and stuff to a computer on the other side of a building which was later dubbed a sneakernet

A second benefit of networks was the ability to share physical resources.

It was also common on early networks to have large, shared, storage drives, ones too expensive to have attached to every machine.

These relatively small networks of close-by computers are called Local Area Networks or LANs

A LAN could be as small as two machines in the same room, or as large as a university campus with thousands of computers.

Although many LAN technologies were developed and deployed, the most famous and successful was Ethernet, developed in the early 1970s at Xerox PARC, and still widely and used today.

In its simplest form, a series of computers are connected to a single, common ethernet cable.

When a computer wants to transmit data to another computer, it writes the data, as an electrical signal, onto the cable.

Of course, because the cable is shared, every computer plugged into the network sees the transmission, but doesn't know if data is intended for them or another computer.

To solve the problem, Ethernet requires that each computer has a Unique Media Access Control, or MAC address.

This unique address is put into a header that prefixes any data sent over the network.

This works really well; every computer made today comes with its own unique MAC address for both Ethernet and WiFi.

The general term for this approach is Carrier Sense Multiple Access, or CSMA for short.

The 'carrier', in this case, is any shared transmission medium that carries data - copper wire in the case of ethernet, and the air carrying radio waves for WiFi.

 

Many computers can simultaneously sense the carrier, hence the "Sense" and Multiple Access", and the rate at which a carrier can transmit data is called it "Bandwidth"

"Bandwidth" describes the maximum data transfer rate of a network or Internet connection. It measures how much data can be sent over a specific connection in a given amount of time.

 

이더넷의 경우는 구리선, Wifi 의 경우 전파를 운반하는 공기를 말합니다.

많은 컴퓨터가 동시에 캐리어를 감지하기 때문에 "감지"와 "다중 접속"이라 하고,

캐리어가 데이터를 전송할 수 있는 속도를 "대역폭"이라고 한다.

 

Unfortunately, using a shared carrier has one big drawback.

When network traffic is light, computers can simply wait for silence on the carrier but as network traffic increases, the probability that two computers will attempt to write data at the same time also increases. This is called a "collision" , and the data gets all garbled up, like two people trying to talk on the phone at the same time.

 

네트워크 정체가 적으면, 컴퓨터는 캐리어의 침묵을 기다렸다가 데이터를 전송하면 된다. 그러나, 네트워크 트래픽이 증가하면, 두 컴퓨터가 동시에 데이터를 쓰려는 확률도 높아집니다.

 

Fortunately, computers can detect these collisions by listening to the signal on the wire.

The most obvious solution is for computers to stop transmitting, wait for silence, then try again.

Problem is the other computer is going to try that too. This just leads to more and more collisions.

Soon, everyone is talking over one another and has a backlog of things they need to say, like breaking up with a girlfriend over a family holiday dinner. Terrible idea.

 

Ethernet had a surprisingly simple and effective fix.

When transmitting computers detect a collision, they wait for a brief period before attempting to re-transmit.

This doesn't work if all the computers use the same wait duration(1s) - they will just collide again one second later.

 

Solution →

So, a random period is added: one computer might wait 1.3 seconds, while another waits 1.5 seconds.

And they will wait for each one to finish the job but it doesn't solve the problem so an extra trick is used.

if a computer detects a collision while transmitting, it will wait 1 second, plus some random extra time.

However, if it collides again, which suggests network congestion, instead of waiting another 1 second, this time it will wait 2 seconds , 4 seconds and then 8, 16 and so on until it's successful.

With computers backing off, the rate of collisions goes down, and the starts moving again, freeing up the network.

Family dinner saved!!!

This "backing off" behaviors using an exponentially growing wait time is called Exponential Back off.

Both Ethernet and WiFi use it, and so do many transmission protocols.

Problem here:

But even with clever tricks like Exponential Backoff, you could never have an entire university's worth of computers on one shared ethernet cable.

To reduce collisions and improve efficiency, we need to shrink the number of devices on any given shared carrier — what's called the Collision Domain.

One collision domain: many computers in one shared cable.

To reduce the collisions, we can break the network into two collision domains by using a Network Switch. It sits between our two smaller networks, and only passes data between them if necessary.

It does this by keeping a list of what MAC addresses are on what side of the network.

If A wants to transmit to C, the switch doesn't forward the data to the other network.

Switch is like a controller.

This means if E wants to transmit to F at the same time, the network is wide open, and two transmissions can happen at once.

Problem here: If F wants to send data to A, then the switch passes it through, and the two networks are both briefly occupied. This is essentially how big computer networks are constructed, including the biggest one of all - The Internet - which literally inter-connects a bunch of smaller networks, allowing inter-network communication.

MEANING → there's often multiple paths to get data from one location to another.

ROUTING

The simplest way to connect two distant computers, or networks, is by allocating a communication line for their exclusive use. This is how early telephone systems worked.

ex) 5 telephone lines running between toronto and new york.

Frank(New York) would tell a human operator where he wanted to call, they would physically connect Frank's phone line into an unused line running to Andrea(Toronto). For the length of the call, that line was occupied, and if all 5 lines were already in use, Frank would have to wait for one to become free. This approach is called "Circuit Switching" because you are literally switching whole circuits to route traffic to the correct destination.

It works fine, but it's relatively inflexible and expensive because there's often unused capacity.

On the upside, once you have a line to yourself - or if you have the money to buy one for your private use - you can use it to its full capacity, without having to share. For this reason, the military, banks and other high importance operations still buy dedicated circuits to connect their data centers.

Another approach for getting data from one place to another is "Message Switching"

Message Switching

It is sort of like how the postal system works.

Instead of dedicated route from A to B, messages are passed through several stops.

ex) Frank(New York) - Andrea(Toronto)

it might go from Chicago to Florida and hop to New Jersey and make it to New York.

Each stop knows where to send it next because they keep a table of where to pass letters given a destination address.

Benefits: it can use different routes, making communication more reliable and fault-tolerant.

What if there's a blizzard in Chicago grinding things to a halt, the Chicago mail hub can decide to route the letter through Boston instead.

In our example, cities are acting like network routers.

The number of hops a message takes along a route is called the "hop count".

Keeping track of the hop count is useful because it can help identify routing problems.

The hop count is stored with the message and updated along its journey so it can detect wasting bandwidth and routing error that needs to be fixed.

If you start seeing messages with high hop counts, you can bet something has gone wrong in the routing! This threshold is the Hop Limit.

A downside to Message Switching is that messages are sometimes big because the whole message has to be transmitted from one stop to the next before continuing on its way. While a big file is transferring, that whole link is tied up. Even if you have a tiny, one kilobyte email trying to get through, it either has to wait for the big file transfer to finish or take a less efficient route. That's really bad.

Solution:

"Packets"

Chop up transmissions into many small pieces, called packets. Just like with Message Switching, each packet contains a destination address on the network, so routers know where to forward them.

This format is defined by the "Internet Protocol", or IP for short, a standard created in the 1970s.

Every computer connected a network gets an IP Address.

With millions of computers online, all exchanging data, bottlenects can appear and disappear in milliseconds.

Congestion Control: Network routers are constantly trying to balance the load across whatever routes they know to ensure speedy and reliable delivery.

Sometimes different packets from the same message take different routes through a network.

This opens the possibility of packets arriving at their destination out of order, which is a problem for some applications.

Fortunately, there are protocols that run on top of IP, like TCP/IP, that handle this issue.

Chopping up data into small packets, and passing these along flexible routes with spare capacity, is so efficient and fault-tolerant, it's what the whole internet runs on today.

This routing approach is called Packet Switching.

It also has the nice property of being decentralized, with no authority or single point of failure.

In fact, the threat of nuclear attack is why packet switching was developed during the cold war.

Packet switching is the transfer of small pieces of data across various networks. These data chunks or “packets” allow for faster, more efficient data transfer. Often, when a user sends a file across a network, it gets transferred in smaller data packets, not in one piece.

Today, routers all over the globe work cooperatively to find efficient routings, exchanging information with each other using special protocols, like the Internet Control Message Protocol(ICMP) and the Border Gateway Protocol (BGP).

 

ARPANET

 

The world's first packet-switched network, and the ancestor to the modern internet, was ARPANET, named after the US agency that funded it, the Advanced Research Projects Agency.

 

Each smaller circle is a location, like a university or research lab, that operated a router. They also plugged in one or more computers. - PDP-1's , IBM System 360s, and even an ATLAS in London connected over a satellite link.

Obviously the internet has grown by leaps and bounds in the decades since.

 

Today, instead of a few dozen computers online, it's estimated to be nearing 10 billion.

'TIL > ETC' 카테고리의 다른 글

History of Web - 2 (original website)  (2) 2020.10.10
Website performance fundamentals  (0) 2020.10.10
traceroute  (0) 2020.10.10
The internet Backbone  (0) 2020.10.10
DNS & IP Address - IPv6  (1) 2020.10.09

comment