Tag Archives: Computer Networking

How To Make The Command Prompt Look & Work Better

by Codrut Neagu published on 09/14/2015. digitalcitizen . life

We like the Command Prompt and we are not alone in that. But, even though it is a mighty and powerful tool, it sure looks boring. What if you want to make it prettier? And what about customizing certain things about the way it works, like how many commands it stores in its history? To learn all this and more, read this tutorial.

NOTE: This article applies for Windows 7, Windows 8.1 and Windows 10.

What Is The Command Prompt?

Before Windows was created, the most used operating system was DOS (Disk Operating System). It was a text-based operating system, that allowed you to run programs by manually typing in commands.

The launch of the Windows operating system simplified the whole computing experience by making it more visual. Even though DOS is no longer included in Windows operating systems since Windows ME (in 2000), we still have the Command Prompt – the text command-line interpreter, analog of the command shell found in the old DOS operating system.

This tool is generally used by geeks and more advanced users, such as system administrators. With it, you can run all kinds of commands. You can manage your partitions, network devices and connections or you can simply run programs and executable files.

Most probably, the Command Prompt will be phased out and, in the future, Windows users will have to learn and use PowerShell if they want to use a powerful command line interpreter. But, for now, let’s see how to launch Command Prompt and how to make it look pretty. It is not as un-customizable as you would think.

How To Start The Command Prompt

This has been shown in detail, in this tutorial: 7 Ways to Launch the Command Prompt in Windows.

When you first open the Command Prompt it opens at your user folder: “C:\Users\Your user name”.

Opera Snapshot_2018-01-10_091650_www.digitalcitizen.life

When you run it as administrator, it opens at the default system folder: “C:\Windows\system32”.

Opera Snapshot_2018-01-10_091836_www.digitalcitizen.life

How To Access The Properties Of The Command Prompt

If you want to customize the way Command Prompt looks and works, you need to access its Propertieswindow. Right click or long press on the top of the Command Prompt window and select Properties.

Opera Snapshot_2018-01-10_092004_www.digitalcitizen.life

You will notice four tabs with options that can be configured in detail: Options, Font, Layout and Colors.

Opera Snapshot_2018-01-10_092116_www.digitalcitizen.life.png

Let’s take a look at these tabs and see what they offer in terms of customization options.

How To Customize The Command Prompt Cursor Size, Buffers And Edit Modes

The first tab is named Options. In Windows 7 and in Windows 8.1, it includes three sections: Cursor Size, Command History and Edit Options.

Opera Snapshot_2018-01-10_092418_www.digitalcitizen.life

In Windows 10, besides the Cursor Size, Command History and Edit Options section, you’ll also find two additional sections for Text Selection and Current code page, and an additional option called Use legacy console.

Opera Snapshot_2018-01-10_092547_www.digitalcitizen.life

Regardless of the operating system you use, the first section – Cursor Size – is about changing the size of the cursor. You can choose one of the available options: Small, Medium or Large.

In the Command History section you can customize how many commands are retained in the command buffer. The buffer serves as a historical record of the commands you have executed. Use the Up and Downarrow keys to navigate through the previously entered commands.

The default value is 50 commands but it can be made as large as 999. The next option, “Number of Buffers”determines for how many concurrent instances of the Command Prompt you’re using separate buffers. For example if you change the value to three, you will be able to have up to three Command Prompt instances opened, each with its own buffer. The last option from this section, “Discard Old Duplicates”, allows Windows to remove duplicate command entries from the buffer.

Both in Windows 7, Windows 8.1 and in Windows 10, the Edit Options section offers options for QuickEdit Mode and Insert Mode. The first one allows you to use the mouse to cut and paste text to and from the Command Prompt window. The second – Insert Mode – has the same function as the Insert keyboard key: the cursor inserts a character at its current position, forcing all characters past it one position further. If Insert Mode is disabled, then when you type, what you’re typing overwrites any text that is present in your current location.

A sample of how QuickEdit Mode works can be viewed in the capture below. With the mouse, we selected the text for copying. We then pressed Enter and the text was copied to the clipboard.

Opera Snapshot_2018-01-10_092708_www.digitalcitizen.life

You can then paste the selected text in any other program.

If you’re using Windows 10, the Edit Options section offers two more options for you to use: Enable Ctrl key shortcuts and Filter clipboard contents on paste. However, in order to be able to use these (and other) new options, you first have to uncheck the last feature from the Options tab: Use legacy console.

Opera Snapshot_2018-01-10_092830_www.digitalcitizen.life

Once you’ve unchecked Use legacy console and relaunched Command Prompt, all the new features brought by Windows 10’s Command Prompt can be enabled.

Let’s go back to the Edit Options section from Windows 10’s Command Prompt. If you Enable Ctrl key shortcuts, Command Prompt will let you use a set of keyboard shortcuts like Ctrl + C or Ctrl + V inside it, which is something you couldn’t do in previous versions. We promise we’ll talk about all the new keyboard shortcuts you can use in Windows 10’s Command Prompt in a very soon to come tutorial.

The last option from the Edit Options section of Windows 10’s Command Prompt is called Filter clipboard contents on paste. If you enable it, whenever you paste content from the clipboard inside Command Prompt, tabs are automatically removed and smart quotes are converted to regular ones.

Going further, Windows 10’s Command Prompt includes a new section called Text Selection. Here, you have two options which you can set: Enable line wrapping selection and Extended text selection keys.

Enabling line wrapping selection enhances the way in which Command Prompt handles text selection. Previous versions of Command Prompt only allowed copying text from it in block mode. That meant that each time you pasted content from Command Prompt in a text editor you had to manually correct tabs, word wrapping etc. If you enable this option, Windows 10 takes care of all that, so you won’t have to correct the flow of text anymore.

If you enable Extended text selection keys, Windows 10’s Command Prompt will allow you to use a set of common keyboard shortcuts inside it. For example, you can use Shift + Arrow keys to select text.

Opera Snapshot_2018-01-10_092952_www.digitalcitizen.life

Current code page is also a new section from Windows 10’s Command Prompt. This section doesn’t include any options for you to set: it only informs you about the character code you use.

How To Adjust The Font Used By The Command Prompt

In the Font tab you can select the size and Font used by the Command Prompt window. Also, you can use the window preview to see the effect of your settings before applying them.

Opera Snapshot_2018-01-10_093125_www.digitalcitizen.life

The Size list displays several values for how large each character is. Then, in the Font list you can select one of the three available fonts.

How to Change the Command Prompt Window Layout & Size

The Layout tab has three sections where you can configure the size of the Command Prompt window. The available options are as follows:

  • Screen Buffer Size – use it to configure how many characters are displayed on a line in the Command Prompt window, by adjusting the Width value. The number of lines that are stored in memory, are adjusted using Height value;
  • Window Size – use it to select the Width and Height of the Command Prompt window;
  • Window Position – enables you to configure the Command Prompt’s window distance from the left and top edges of the screen. This can be done only if the “Let System Position Window” box is not checked;
  • Let System Position Window – if it’s checked, you won’t be able to configure the window position settings but you can drag and drop, or resize the Command Prompt window with the mouse. 

Opera Snapshot_2018-01-10_093321_www.digitalcitizen.life

Next, let’s take a look at the final tab.

How To Set The Window Colors For The Command Prompt

The Colors tab is all about customizing the colors used by the Command Prompt. There are four items that can be customized:

  • Screen Text – use it to set the color of the text, in the Command Prompt window;
  • Screen Background – use it to choose the background color of the Command Prompt window;
  • Popup Text – use it to set the color of the text displayed in pop-up windows triggered by the Command Prompt;
  • Popup Background – use it to set the background color of the pop-up windows triggered by the Command Prompt.

Opera Snapshot_2018-01-10_093557_www.digitalcitizen.life

If you’re using Windows 10, Command Prompt also lets you set its transparency. Underneath all the sections from its Colors tab, you’ll find a section called Opacity. Moving the slider from this section will let you change the transparency of the Command Prompt to the level you want. Note however, that this option is only available if you unchecked the Use legacy console setting from the Options tab.

Opera Snapshot_2018-01-10_093720_www.digitalcitizen.life

When you are done changing your settings, all that remains to do is for you to click or tap OK to apply them.


As you can see from this guide, there are plenty of customization options that allow you to make the Command Prompt friendlier than it seems at first sight. If you are looking for other useful tips about the Command Prompt, don’t hesitate to read the articles recommended below.

Command Prompt – Four Networking Commands you should know

by Codrut Neagu published on 05/25/2016. digitalcitizen . life

In one of our previous tutorials, you learned how to use basic commands in Command Prompt . Now it’s time to take things to the next level and see how to use some of the more advanced commands. Today, we’re going to take a close look at some very useful network commands. We will learn about things like how to view information about network devices and connections or how to check the availability of a network host or internet website. For all this, and more, read this tutorial:

NOTE: The information shared in this tutorial applies to Windows 10, Windows 8.1 and Windows 7. For simplicity, we will use screenshots taken in Windows 10.

1. Retrieving information about your network connections

To obtain detailed information about your network connection, use the ipconfig command. Open Command Prompt , type ipconfig and press Enter . As you can see in the screenshot below, when you run this command, Windows displays a list with all the network devices found on your system and their IP addresses. You also get details like the default gateway, subnet mask or the state of the network adapter.


If you add the /all switch to the ipconfig command, you can get to a whole new level of detail: DNS information, the MAC (Media Access Control) (in the Physical Address field) and other information about each network component. Check out the picture below to see a sample of what you’ll get from the “ipconfig /all” command .


It’s worth mentioning that the ipconfig command also allows you to perform some other operations, if you use the right parameter. For example, the “ipconfig /release” and “ipconfig /renew” commands force your network adapter to drop and renew the current IP address.

The release and renew parameters are useful in networks that use DHCP (Dynamic Host Configuration Protocol) to distribute IP addresses automatically. Basically, your system gives up its current address and requests a new one from the DHCP server, and that can help you troubleshoot certain network issues.

2. Finding your network adapter’s MAC addresses

Another way to obtain the MAC addresses of your network adapters is to use the getmac command. In Command Prompt , type getmac and press Enter , like in the image below.


3. Testing the connection to a website or to a network location

To test your connection to a certain website or another network or internet location, you can use the ping network command, followed by a web address or IP address. For instance, if you want to check the connectivity to Digital Citizen , without opening a web browser, type the command “ping www . digitalcitizen . life“ and then press the Enter key on your keyboard .


The ping command also allows you to use the very useful “-t” parameter, which enables you to ping the specified address forever until it’s manually stopped.

For instance, we typed “ping -t www dot digitalcitizen dot life” . After some time, we wanted to see some connection statistics and we used the keyboard combination “CRTL + Break” . This shows the averages of the ping commands run until then.

Finally, we terminated the command by using the keyboard combination “CTRL + C” . This stops the endless cycle of ping commands to the specified address.


4. Check your computer’s network connections and open ports

The netstat command lets you see the network connections that are active between your system and any other systems on your network or the internet.


If you add the -a parameter to the netstat command, you can get a list with all the connections and listening ports, like in the image below.



The networking commands that you can run in the Command Prompt can be useful when you need to find information about devices connected to your network or when you want to test your network connections state . They’re also very useful when you have networking issues and you’re trying to troubleshoot them by yourself. If you have any questions about the networking commands, or if you need help with any of them, don’t hesitate to leave us a comment below


How to Use Traceroute to Identify Network Problems

by Chris Hoffman on January 19th, 2013


Traceroute is a command-line tool included with Windows and other operating systems. Along with the ping command, it’s an important tool for understanding Internet connection problems, including packet loss and high latency.

If you’re having trouble connecting to a website, traceroute can tell you where the problem is. It can also help visualize the path traffic takes between your computer and a web server.

How Traceroute Works

When you connect to a website – say, howtogeek dot com – the traffic has to go through several intermediaries before reaching the website. The traffic goes through your local router, your Internet service provider’s routers, onto larger networks, and so on.

Traceroute shows us the path traffic takes to reach the website. It also displays the delays that occur at each stop. If you’re having issues reaching a website and that website is working properly, it’s possible there’s a problem somewhere on the path between your computer and the website’s servers. Traceroute would show you where that problem is.

We’ve used traceroute to explain – and demonstrate — who provides the Internet service for your Internet service provider.

In more technical terms, traceroute sends a sequence of packets using the ICMP protocol (the same protocol used for the ping command.) The first packet has a time-to-live (also known as TTL, or hop limit) of 1, the second packet has a TTL of 2, and so on. Each time a packet is passed to a new router, the TTL is decreased by 1. When it reaches 0, the packet is discarded and the router returns an error message. By sending packets in this manner, traceroute ensures that each router in the path will discard a packet and send a response.

How to Use Traceroute

Traceroute is run from a command prompt or terminal window. On Windows, press the Windows key, type Command Prompt, and press Enter to launch one.

To run a traceroute, run the tracert command followed by the address of a website. For example, if you wanted to run a traceroute on How-To Geek, you’d run the command:

tracert howtogeek dot com

(On Mac or Linux, run traceroute howtogeek dot com instead.)

You’ll gradually see the route take form as your computer receives responses from the routers along the way.


If you run a traceroute for another website – particularly one hosted in a different region of the world – you’d see how the paths differ. The first “hops” are the same as the traffic reaches your ISP, while the later hops are different as the packets go elsewhere. For example, below you can see the packets travelling to Baidu dot com in China.


Understanding the Output

The basic idea is self-explanatory. The first line represents your home router (assuming you’re behind a router), the next lines represent your ISP, and each line further down represents a router that’s further away.

The format of each line is as follows:

Hop RTT1 RTT2 RTT3 Domain Name [IP Address]

  • Hop: Whenever a packet is passed between a router, this is referred to as a “hop.” For example, in the output above, we can see that it takes 14 hops to reach How-To Geek’s servers from my current location.
  • RTT1, RTT2, RTT3: This is the round-trip time that it takes for a packet to get to a hop and back to your computer (in milliseconds). This is often referred to as latency, and is the same number you see when using ping. Traceroute sends three packets to each hop and displays each time, so you have some idea of how consistent (or inconsistent) the latency is. If you see a * in some columns, you didn’t receive a response – which could indicate packet loss.
  • Domain Name [IP Address]: The domain name, if available, can often help you see the location of a router. If this isn’t available, only the IP address of the router is displayed.

You should now be able to use the tracert command and understand its output.


Perintah CMD Untuk Jaringan Komputer

January 07, 2018 / Admin Saktipedia

Perintah CMD Untuk Jaringan Komputer – Berikut adalah perintah-perintah pada Command Prompt yang berhubungan dengan jaringan komputer. Untuk melakukan perintah-perintah tersebut Anda harus masuk ke Command Prompt (Klik Start ->Run ->Ketik CMD)

Perintah CMD Untuk Jaringan Komputer

  • ipconfig /all Menampilkan informasi konfigurasi koneksi, misalnya Host Name, Primary DNS Type, Ethernet Adapter LAN.
  • ipconfig /flushdns Menghapus DNS Cache
  • ipconfig /release “Menghapus” semua koneksi IP Address.
  • ipconfig /renew Membuat IP Address baru untuk adapter tertentu.
  • ipconfig /displaydns Menampilkan DNS Cache.
  • ipconfig /registerdns Melakukan refresh DNS dan meregister kembali koneksi DNS.
  • ipconfig /showclassid Menampilkan informasi DHCP Class.
  • ipconfig /setclassid Mengubah DHCP Class ID
  • control netconnections Menampilkan Network Connection.
  • nslookup Mengetahui alamat ip address dari nama domain yang di tuliskan
  • netstat Menampilkan informasi koneksi TCP/IP yang sedang aktif.
  • route Menampilkan local route.
  • hostname Menampilkan nama komputer.
  • ping Melakukan test koneksi ke situs / website. Semakin sedikit % loss-nya maka semakin baik koneksinya.
  • tracert Menampilkan informasi IP Address route


Cara Membuat Jaringan LAN

December 29, 2017 / Admin Saktipedia

Cara Membuat Jaringan LAN – Jaringan LAN merupakan jaringan komputer local yang digunakan untuk area terbatas seperti rumah,gedung ataupun sekolah. Jaringan LAN sangat mudah dibuat karena hanya membutuhkan beberapa peralatan dan setting pada komputer.

Alat untuk membangun sebuah jaringan LAN

  • Router

Router adalah jantung pada sebuah jaringan. Router berfungsi untuk menghubungkan jaringan satu dengan jaringan lain. Dalam kasus ini, router menghubungkan jaringan internet dengan jaringan LAN

  • Switch

Berbeda dengan router, switch berfungsi untuk menghubungkan masing-masing komputer pada sebuah jaringan LAN

  • Ethernet Card

Ethernet card adalah sebuah adapter untuk mencolokkan kabel ethernet sehingga komputer bisa tersambung menuju jaringan. Biasanya, pada komputer-komputer terbaru, kartu ini telah disematkan secara onboard sehingga anda tidak perlu untuk membeli lagi.

  • Ethernet Cable

Yaitu kabel yang digunakan untuk menghubungkan komputer ke router atau bisa juga komputer satu dengan komputer lain. Ujung pada kabel ini diberi sebuah konektor yang disebut RJ-45. RJ-45 memiliki 2 settingan, yaitu straight dan cross. Straight digunakan untuk menghubungkan komputer ke router sedangkan cross digunakan untuk menyambungkan komputer langsung dengan komputer.

  • Modem 

Jika anda ingin menghubungkan jaringan anda ke internet, maka anda juga harus membeli sebuah modem. Jika anda tidak membeli sebuah modem, maka komputer anda hanya bisa berkomunikasi dengan komputer lain yang terdapat pada jaringan LAN tersebut.

  • Peralatan Lain

Crimping tool, LAN tester, gunting, multimeter

Crimping tool digunakan untuk menyambungkan RJ-45 dengan kabel ethernet. LAN tester digunakan untuk testing kabel LAN telah berfungsi atai tidak. Sebagai alternatif untuk mempercepat ataupun mempermudah pekerjaan anda, anda bisa meminta tolong kepada penjual kabel ehternet misalnya untuk sekaligus memasangkan RJ-45 sehingga anda tinggal memasangkan kabel-kabel tersebut menuju router dan komputer.

Sebelum menyiapkan peralatan di atas. sangat disarankan anda melakukan perencanaan terlebih dahulu, yaitu meliputi jumlah komputer, luas area, dengan begitu anda bisa membuat rancangan kabel yang efektif sehingga bisa menghemat biaya yang dibutuhkan. anda bia menggunakan software seperti paint untuk membuat rancangan penataan jaringan LAN Anda. Setelah itu, barulah anda beli perlengkapan yang diperlukan dan pasangkan perlatan-peralatan di atas.

Berikut adalah model yang akan kita pakai untuk membangun jaringan LAN (bisa juga untuk Warnet). 


  1. Adalah Internet
  2. Adalah modem sekaligus Router yang menghubungkan komputer server menuju internet
  3. Komputer server
  4. Switch 

Setelah hardware terpasang, sekarang adalah tahap untuk setting software. setting ini meliputi instalasi OS, setting network connection, konfigurasi TCP/IP address, terakhir adalah uji coba jaringan yang telah anda pasang.

Mengaktifkan Internet Connecting Sharing

  • ICS bertujuan untuk membagikan koneksi internet komputer host menuju komputer lainnya.
  • Untuk mengaktifkan ICS pada komputer server, silahkan buka Control Panel, klik Network and Internet, klik Network and Sharing Center, klik Change Adapter Center, Klik kanan pada koneksi yang ingin anda bagikan, klik Properties, klik tab Sharing, lalu centang kotak Allow other network users to connect through this computer’s Internet connection, simpan.
  • Oke, sampai tahap ini, hanya komputer server yang bisa terhubung ke internet. Setelah koneksi dibagikan, maka masing-masing komputer harus mendapatkan IP address. Caranya,
  • buka Control Panel, klik Network and Internet, klik Network and Sharing Center, klik Change Adapter Center. 
  • Klik kanan pada Koneksi LAN, Klik Properties
  • Klik Internet Protocol Version 4 (TCP/IPv4) atau Internet Protocol Version 6 (TCP/IPv6), kemudian pilih properties
  • klik Obtain an IP address automatically atau Obtain an IPv6 address automatically.


Introduction to Computer Networking


  • Computer Networks are like a phone system for computers
  • A computer places a “call” to exchange data with another computer
  • The communication is always just bytes
  • Worth knowing the basics, you are using the network constantly
  • When you wake up, how long passes before using a network?

Computer networks are complicated in the details, but the basic ideas of how it all works are surprisingly simple, and that’s what we’re going to study.

The Internet is like a global phone system for computers: a computer can “call” another computer on the internet to get or send a little information. Suppose your laptop is connected to the internet, and you type “http://www.nytimes.com” into your browser — what happens? Your computer contacts the computer “www.nytimes.com” — placing a “call” in effect — and sends a request for the main web page. The request is small, about 1KB (1 kilobyte). The http://www.nytimes.com machine sends back a large response which is the web page — maybe 200KB — and ends the call. Your browser gets back all this data and formats it for your screen so you can read the text, click links etc. We’ll look at this fetch-web-page example a few different ways to see how the internet works.

LAN – Local Area Network

  • Start with small scale
  • LAN – Local Area Network
  • One house, one floor of a building
  • Later, show scale up to world-wide internet
  • Two super popular LAN technologies
    • Ethernet, wired LAN
    • Wi-Fi, wireless LAN

We’ll start by looking at LAN (local area network) technology — connecting 2-50 computers in a house or on one floor of a building.

Ethernet LAN – Bandwidth

  • Very popular wired LAN technology, 1974
  • Wires about as thick as a drinking straw
  • 100 meter max wire length
  • Wires often yellow or blue
  • RJ-45 plug, like a big phone plug
  • bandwidth speed – bits per second
  • Typical bandwidth numbers:
    • 100 megabits, 100 million bits per second, aka 100 mbps
    • 1 gigabit, 1 billion bits per second, aka 1 gbps, 1000 mbps
  • Letter “b” confusion – note “mbps” and “gbps” refer to bits not bytes
  • Networking speeds generally quoted in bits-per-second, as above


Ethernet RJ45 plug


Ethernet cables plugged into the back of a Wi-Fi router (Linksys WRT54g)

Ethernet is an extremely common and influential wired LAN standard, so we’ll start there. Ethernet cable lengths are typically limited to 100 meters, in keeping with its “local” orientation. A typical LAN application is networking the computers in one room or in one floor of a building. The most common form of ethernet wiring is 100base-T (100 megabit) with “RJ-45” connectors on the ends. An RJ-45 connector is about the size of your pinkie finger, like a wide phone wire plug.

Packets – Data From Here to There

  • e.g. send an image file between ethernet connected computers
  • This is the “one hop” LAN case (scale up to whole world later)
  • e.g. 50KB image.jpg
  • 50,000 bytes
  • How to send the image.jpg on the wire?
  • Use packets
  • Divide bytes of image.jpg into packets
  • Say each packet is 1500 bytes (varies)
  • Then image.jpg divides into about 32 packets
  • Network transmits one packet at a time


We’ll start with the simplest case of two computer connected with an ethernet cable, and we want to send a 50KB jpeg image file from one computer to the other. This is the “one-hop” case .. networking between two computers separated only by an ethernet cable. Later we’ll scale this up to the full Internet case of two computers on separate sides of the world. The first question is: how are the bytes of the image file on one computer sent to the other computer over the ethernet cable (or over Wi-Fi)?

For transmission, the 50KB of the image is divided into packets. The packet is the natural unit of transmission within networking. In this case, say each packet is about 1500 bytes (a typical packet size), then the bytes of the 50KB image could be divided into about 32 packets of around 1500 bytes each. It is not required that all the packets be the same size, just that every byte of the image is sent in one packet or another.

Ethernet – Sending One Packet

  • Look at transmission of one 1500 byte packet
  • Each byte is 8 bits, e.g. 0 1 1 0 1 0 1 0
  • 1500 bytes * 8 bits-per-byte = 12000 bits total
  • Send each byte (slight simplification):
    • Go through all the bits, from left to right
    • For each 1, put 3 volts on the wire
    • For each 0, put 0 volts on the wire
  • To receive the packet:
    • Follow along the pattern of 3 volts / 0 volts coming down the wire
    • Assemble the 0’s and 1’s in groups of 8 to make each byte
  • Digital transmission – just 0’s and 1’s
  • Proceeds at around 2/3 the speed of light (varies)


Ethernet provides a basic facility to transmit a packet between two computers connected by the ethernet cable. Say we have a packet of 1500 bytes of information we want to send. Each byte is 8 bits, so that’s 12000 bits to send, where each bit is a 0 or 1. Here’s an oversimplification that captures how it works: the ethernet cable contains two wires connecting the computers. The sending computer could read through the 12000 bits in order, and for each 1 bit, put 3 volts between the wires, and for each 0 bit, put 0 volts between the wires. The receiving computer can follow along, noting the 3v/0v pattern on the wires over time and so receive the 12000 bits. In reality the most recent ethernet contains 4 pairs of wires and supports sending information in both directions and with a more complex voltage scheme. However, this pattern of going through the bits and varying the voltage to “send” each bit is essentially how it all works.

Checksum vs. Errors

  • Checksums detect transmission errors
  • Allow the receiver to detect that a packet was received correctly
  • Example checksum scheme:
    • Each byte is a number from 0-255
    • Sender adds up all packet’s bytes, say the sum is 157231
    • Take the last 2 digits, 31, as the “checksum” of the packet
    • Sender appends a checksum byte at the end of the packet
    • Receiver: add up the bytes received, check that the checksum matches
  • Checksum not matching indicates data corruption
  • Receiver asks the sender to re-send that packet
  • Very likely to detect errors
  • Not perfect – 2 errors could cancel out
  • Actual checksum schemes used are better than just the sum
  • Checksums are very widely used:
  • Ethernet, USB, Wi-Fi, … everything!
  • This is how your file transfers get every bit correct
  • Recall analog/digital theme: once the data is numbers, many useful algorithms are easy. Checksums are another example.

Packet checksum example:


Each packet includes extra checksum bytes, so the receiver of the packet can detect if some of the bits in the packet got corrupted in transmission. A simple example checksum scheme would be: go through all the bytes, and add them all up. The checksum is the last 2 digits of the sum of all the bytes; send that checksum as an extra byte along with the rest of the packet data. The receiver can do the same computation — adding up all the bytes — to check that they get the same checksum. The actual checksum algorithm is more complex than just adding up the bytes, and is more capable of detecting errors. The checksum is probabilistic, not detecting 100% of errors; there is a microscopic chance that an error occurs but the checksum does not catch it.

The checksum allows the receiver to notice that a packet did not come through right, and get the sender to re-send that packet. Most packets get through fine, but re-sending a few packets happens all the time in your life. In this way, when you send a JPEG file from one place to another, it comes through correctly, down to every last bit.