What is a socket? What is a Socket and what are they? Network theory and low levels.

04.08.2023

What is a socket?

You constantly hear talk about some kind of “sockets” and you are probably wondering what they are. In general, sockets are originally a way for programs to communicate with each other using Unix file descriptors.

OK -- you've probably heard some Unix hacker say something like, "Oh my God, everything in Unix is ​​files!" This person may have meant that Unix programs read or write to a file descriptor for absolutely any I/O. The file descriptor is a simple integer associated operating system With open files. But (and this is the catch) the file can also be network connection, and FIFO, and pipes, and terminal, and a real file on disk, and just anything else. Everything in UNIX is a file! So, just trust that if you are going to communicate with another program over the Internet, you will have to do it through a file descriptor.

"Hey, smart guy, where do I get this file descriptor to use on the network?" I will answer.
You are making a socket() system call. It returns a socket handle and you communicate through it using system calls send() and recv() (man send, man recv).

"But, hey!" you might exclaim. "If this is a file descriptor, why can't I use simple functions read() and write() to communicate through it?" The answer is simple: "You can!" The slightly longer answer is: "You can, but send() and recv() offer much more control over the transmission of your data."

What's next? How about this: there are different types sockets. There are DARPA Internet addresses (Internet Sockets), CCITT X.25 addresses (X.25 sockets that you don't need), and probably many others depending on the specifics of your OS. This document describes only the first, Internet Sockets.

Two types of Internet sockets

What? Are there two types of internet sockets? Yes. Okay, no, I'm lying. There is more, but I don't want to scare you. There are also raw sockets, a very powerful thing, you should take a look at them.

OK. What are the two types? One of them is a “stream socket”, the second is a “datagram socket”, henceforth they will be called “SOCK_STREAM” and “SOCK_DGRAM”, respectively. Datagram sockets are sometimes called "connectionless sockets" (although they can also connect() if you really want to. See connect() below.)

Stream sockets provide reliability with their two-way communication system. If you send two elements to the socket in the order “1, 2”, they will arrive to the “interlocutor” in the same order - “1, 2”. In addition, error protection is provided.

What uses stream sockets? Well, you've probably heard about the Telnet program, right? Telnet uses a stream socket. All the characters you type should arrive on the other end in the same order, right? Additionally, browsers use the HTTP protocol, which in turn uses stream sockets to fetch pages. If you telnet to any website on port 80 and type something like "GET / HTTP/1.0" and press enter twice, a bunch of HTML will fall on you ;)

How do stream sockets achieve high levels of data transfer quality? They use a protocol called "The Transmission Control Protocol", otherwise known as "TCP". TCP ensures that your data is transmitted consistently and without errors. You may have previously heard of TCP as half of "TCP/IP", where IP stands for "Internet Protocol". IP deals primarily with Internet routing and is not itself responsible for data integrity.

Cool. What about datagram sockets? Why are they called connectionless? What's the matter? Why are they unreliable?
Well, here are some facts: if you send a datagram, it can get through. Or maybe it won't come. But if it does arrive, then the data inside the package will be without errors.

Datagram sockets also use IP for routing, but do not use TCP; they use "User Datagram Protocol", or "UDP".

Why doesn't UDP establish connections? Because you don't need to keep an open connection with stream sockets. You simply construct a packet, form an IP header with recipient information, and send the packet out. There is no need to establish a connection. UDP is typically used either where the TCP stack is unavailable, or where one or two missed packets does not lead to the end of the world. Application examples: TFTP (trivial file transfer protocol, FTP's little brother), dhcpcd (DHCP client), network games, streaming audio, video conferencing, etc.

"Wait a minute! TFTP and DHCPcd are used to transfer binary data from one host to another! Data cannot be lost if you want to work with it properly! What kind of dark magic is this?"

Well, my human friend, TFTP and similar programs usually build their own protocol on top of UDP. For example, the TFTP protocol states that for every packet received, the recipient must send back a packet saying "I got it!" ("ACK" packet). If the sender of the original packet does not receive a response within, say, 5 seconds, it will resend the packet until it finally receives an ACK. Such procedures are very important for implementing reliable applications that use SOCK_DGRAM.

For applications that don't require such reliability - games, audio or video - you simply ignore the lost packets or perhaps try to compensate for them somehow. (Quake players usually call this phenomenon "damned lag", and "damned" is an extremely mild term).

Why would you want to use an untrusted underlying protocol? For two reasons: speed and speed. This method is much faster, fire-and-forget, than constantly monitoring whether everything has arrived safely at the recipient. If you're sending a chat message, TCP is great, but if you're sending 40 character positional updates per second, it might not be that important if one or two of them get lost, and UDP is a good choice.

Network theory and low levels

Since I just mentioned protocol layers, it's time to talk about how the network actually works and show examples of how SOCK_DGRAM packets are constructed. You can actually skip this section, but it is a good theoretical reference.

Hey kids, it's time to talk about data encapsulation! This is a very, very important thing. This is so important that you should learn it by heart.
Basically the gist is this: the package is born; the packet is wrapped (“encapsulated”) in a header by the first protocol (say, TFTP), then the whole thing (including the TFTP header) is encapsulated again by the next protocol (say, UDP), then again by the next one (say, IP), and finally by the final one, physical protocol (say, Ethernet).

When another computer receives the packet, the hardware ( LAN card) strips the Ethernet header (unfolds the packet), the OS kernel strips the IP and UDP headers, the TFTP program strips the TFTP header, and finally we get the bare data.

Now we can finally talk about the infamous OSI model - the layered network model. This model describes a network functionality system that has many advantages over other models. For example, you can write in your program as sockets that send data without worrying about how the data is physically transmitted (serial port, Ethernet, modem, etc.), as programs at lower levels (OS, drivers) do do all the work for you, and present it transparently to the programmer.

Actually, here are all the levels of the full-scale model:


  • Applied

  • Executive

  • Session

  • Transport

  • Network

  • Duct

  • Hardware (physical)

The physical layer is the hardware; com port, network card, modem, etc. The application layer is the furthest away from the physical layer. This is where the user interacts with the network.

For us, this model is too general and extensive. A network model we can use might look like this:


  • Application layer (Telnet, FTP, etc.)

  • Host-to-host transport protocol (TCP, UDP)

  • Internet Layer (IP and Routing)

  • Network access level (Ethernet, Wi-Fi or whatever)

Now you can clearly see how these layers correspond to the encapsulation of the original data.

See how much work it is to create one simple package? Wow! And you must type all these packet headers yourself in notepad! Kidding. With stream sockets, all you have to do is send() the data out. The OS kernel will build TCP and IP headers, and the hardware will take over the network access layer. Ah, I love modern technology.

This concludes our brief excursion into network theory. Oh yes, I forgot to tell you: everything I wanted to tell you about routing: nothing! Yes, yes, I won't say anything about it. The OS and IP protocol will take care of the routing table for you. If you are really interested, read the documentation on the Internet, there is a lot of it.

During the upgrade process or when configuring a new system unit, one of the main factors for its successful assembly is the correctly selected and compatible components. To achieve this, manufacturers have introduced certain standards for the compatibility of these same components.

For example, by replacing central processor, there is another designation (CPU), it is very important to understand exactly what type of socket it has and whether it will fit the connector on the motherboard of a personal computer.

What it is

Basic and very important parameter motherboards - central processor socket (CPU socket). This is a socket located on the main board of the computer, intended for installing a CPU into it. And before connecting these components into one coherent system, you need to determine whether they are compatible with each other or not. It's like plugging a plug into a socket., if the plug is American standard and the socket is European, then naturally they will not fit together and the device will not work.

As a rule, in retail outlets selling computer components, in the price tag on the window or in the price list, the main parameters of the processor that is being sold are always indicated. Among these parameters, the type of socket to which it is suitable is indicated. this processor. The main thing when buying is to take into account this primary characteristic of the CPU.

This is important because when installing the processor into the motherboard socket, if you choose the wrong socket, it simply will not fit into its place. In the huge selection of connectors that exist today, there are two main types:

  • Sockets for central processors from the manufacturer AMD.
  • Sockets designed for processors manufactured by Intel.

Intel and AMD socket specifications

  • Physical dimensions of socket.
  • The method of connecting the contacts of the socket and the processor.
  • Type of mounting of the CPU cooler cooling system.
  • The number of sockets or contact pads.

Connection method - there is nothing complicated here. The socket has either sockets (like AMD) into which the processor contacts are inserted. Either pins(like Intel), on which the flat contact pads of the CPU rest. There is no third option here.

The number of sockets or pins - there are many options here, their number can range from 400 to 2000, and maybe even more. You can determine this parameter by looking at the marking of the socket, in the name of which is encoded this information. For example, the Intel Core i7-2600 for the Intel LGA 1155 processor socket has exactly 1155 contact pads on its surface. The abbreviation LGA means that the processor has flat contacts, and the socket, on the contrary, consists of 1155 pins.

Well, the mounting methods for the CPU cooling system may differ: in the distance between the holes on the motherboard designed to secure the lower part of the cooling system. And the method of fixing the upper half, consisting of a radiator and cooler. There are also exotic cooling options made at home, or systems with a water method of lowering the CPU temperature.

There are other characteristics that are directly related to the functionality of the entire motherboard and its performance. The presence of a socket of a certain standard also indicates what possible parameters are included in this platform and how modern this motherboard is. Here are some features that distinguish a board built on a specific socket and a chipset developed for it:

  • Processor clock speed range, number of supported cores and data transfer speed.
  • The presence of controllers on the motherboard that expand the functionality of the board.
  • Support or presence of a built-in graphics adapter in the motherboard or main processor.

How to determine the socket of a processor

The main component that performs the main task in the operation of a computer is the CPU. And if it fails, then there is nothing left to do but replace it with an analogue similar in connector and characteristics . This is where the challenge arises by determining the socket type. There are many options to find out, and here are three main and available ones.

By manufacturer and model

An easy method using access to World Wide Web(i.e., via the Internet). All the necessary data on products produced by a particular motherboard manufacturing company is available on the manufacturers’ official websites. The information is not hidden anywhere and can be studied by anyone. You just have to enter the data you need for this into the search bar.

Here is an approximate sequence of actions:

Via Speccy

  1. Download and install the Aida64 or Speccy application on your computer. Next, let's consider the second option. Open Speccy program. And find in it the section with CPU parameters, it should be called “Central Processor”.
  2. Next, in the selected section, find the line called “Constructive” and read its contents. This is where the type of processor socket will be indicated.
  3. Approximately the same steps will need to be performed when using the Aida64 program. Section “Computer”, subsection DMI, then in the subsection “Processor”, look for a line with the word Socket.

In the documentation

This method is the easiest, but requires documentation attached to system unit at the time of buying. Among the many instructions for the motherboard, processor, video adapter and other components from which the computer is assembled, those intended for the CPU and motherboard are suitable. Carefully scroll through the entire manual and look in it for the words: connector, socket type. This is where information about the socket standard of the motherboard or processor should be.

A personal computer is not a cheap thing, and in some versions it can even cost as much as an old used car. And change it very often- it's a pretty unprofitable business. Even reputable and successful companies do this relatively rarely. But, despite this, from time to time you still have to upgrade and speed up the computing capabilities of any computer.

To do this, you have to disassemble the old hardware and find out information about certain characteristics and parameters. However, you need to take into account your abilities for such procedures. Here, as people say: “If you can’t, don’t bother.” And if there is uncertainty about the success of such an event, then it is better to contact special service centers or to individual experienced craftsmen.

Processor socket- connector, a place on the computer where the processor is inserted. The processor, before it is installed on the motherboard, must fit the socket. It's like a socket and a contact plug - needless to say, a Euro plug will not fit into a simple Soviet socket.

Usually in computer stores, next to each processor you can see a sign that lists its main characteristics. So the processor socket is almost the most important characteristic and this is what you should first pay attention to when buying a new processor. Because it may happen that the processor will not fit the computer’s motherboard precisely because of the socket.

Just imagine - you came to a computer store, chose a processor there, paid money for it and came home happy, you start installing it - but it DOES NOT FIT! You drop everything, run back to the store, hoping to return this processor back and thereby correct the situation, you come running, and they tell you - “this is not a warranty case, you should have looked more carefully when you bought it.” Well, okay, it was a small lyrical digression. Now let’s talk specifically about these same sockets.

The whole variety of sockets can be divided into two large groups:

  1. Intel processor sockets.
  2. AMD processor sockets.

Below are photos of sockets from both processor companies.

In this photo you can see that the "legs" of the contacts are sticking out from the socket on the motherboard.

In this photo, on the contrary, you can see the recesses for these contacts, and they themselves are located directly on the processor.

Let's see why it's so radical sockets differ from each other physically:

  • Number of contacts
  • The type of these same contacts
  • Mounting distance for CPU coolers
  • The actual size of the socket itself

Number of contacts - there can be 400, 500, 1000 and even more. How to find out? The socket markings already contain all the information. For example, the Intel Pentium 4 processor has an LGA 775 socket. So 775 is exactly the number of contacts, and LGA means that the processor does not have contact legs (pins), they are located in the motherboard socket.

Type of contacts - everything is clear here, either “pins” or contacts without pins. As they say, there is no other option.

Now about the distances between the mounts for processor coolers. The fact is that these distances are different for each socket and you also need to pay special attention to this. Although there are do-it-yourself methods, when a cooler from one socket is attached to another socket with the help of skillful hands and something else...

These were all physical differences, now let's talk about how the sockets are so different from each other in terms of technology. A technologically, sockets differ from each other:

  • Availability of various additional controllers
  • The presence or absence of support for graphics integrated into the processor (processor graphics core)
  • Higher performance parameters

What else does the processor socket affect?

In addition to what has already been written here, CPU socket also affects the size of the processor itself. Generally speaking, if I try to put it very briefly, the processor socket affects which processor will be installed in it. Everything else (for example, what will be written here later in the text) depends on the processor, but you and I know that the processor and the socket are two inseparable concepts. Therefore, all those parameters that depend on the processor (or are influenced by the processor) also depend on the socket of this processor.

Perhaps, I’ll give a few more points that the processor (or its socket) can influence, in other words, the processor or its socket influences:

  • Type of supported RAM
  • FSB bus frequency
  • Indirectly (mostly chipset) to the PCI-e slot version
  • To the version (also indirectly)

What is a socket for anyway?

The fact is that manufacturers of modern motherboards have purposefully left behind us the opportunity to change various devices, including the processor. This is where the concept of a socket appears, because from the point of view of manufacturers, it would be quite possible to solder the processor directly to the motherboard. board, and in terms of reliability it is more advisable. But this was done, frankly speaking, on purpose - i.e. for a possible system upgrade. In other words, we wanted to replace the processor with another - we pulled it out of the socket and inserted the one we needed, of course with the amendment that it should have the same socket as the old processor. In truth, it is for the possible modernization of computer hardware that the vast majority of slots and connectors that are found on the motherboard exist.

Now let's talk about socket support for various processors. Below is a table with popular (at the time of publication of the material) sockets and their corresponding processors:

SocketCPU
LGA 775 (Socket T), year of production - 2004Intel Pentium 4
Pentium 4 Extreme Edition
Intel Celeron D
Pentium D
Pentium Extreme Edition
Pentium Dual-Core
Core 2 Duo
Core 2 Extreme
Core 2 Quad
Xeon (for servers)
LGA 1366 (Socket B), year of production - 2008Intel Core i7 (9xx)
Intel Celeron P1053
LGA 1156 (Socket H), production year - 2009Intel Core i7 (8xx)
Intel Core i5 (7xx, 6xx)
Intel Core i3 (5xx)
Intel Pentium G69x0
Intel Celeron G1101
Intel Xeon X,L (34xx)
LGA 1155 (Socket H2), production year - 2011 Sandy Bridge and Intel Ivy Bridge
LGA 1150 (Socket H3), planned year of release - (2013-2014)Intel Haswell and Intel Broadwell
Socket 939, year of production - no dataAthlon 64
Athlon 64 FX
Athlon 64 X2
Socket AM2, year of production - 2006Athlon 64 (not all)
Athlon 64 X2 (not all)
Athlon X2
Athlon 64 FX-62
Opteron 12xx
Sempron (some)
Sempron X2
Phenom (limited support)
Socket AM2+, year of production - 2007Athlon X2
Athlon II
Opteron 13xx
Phenom
Phenom II
Socket AM3, year of production - 2009Phenom II (except X4 920 and 940)
Athlon II
Sempron 140
Opteron 138x
Socket AM3+, year of production - 2011AMD FX-Series(AMD FX-4100 AMD FX-6100 and AMD FX-8120 AMD FX-8150)
Socket FM1, year of production - 2011All microarchitecture processors AMD Fusion
Socket FM2, year of production - 2012All microarchitecture processors Bulldozer

And in conclusion, a small recommendation for those who are going to buy a new processor: before purchasing, always check the compatibility of the motherboard socket and processor. For example if motherboard has an LGA775 socket - take processors that are made specifically for this socket, no other processors will work. Published: 02/03/2017

Greetings, friends.

Today's article will be about PC sockets. Mainly about modern types. As the article progresses, we will understand the differences between sockets and look at the main characteristics. Let's decide what you should pay attention to when choosing a socket.

What are PC sockets

A socket is a connector on a personal computer board designed to connect a central processing unit (CPU). Desktop computers use a processor connection via a socket. On laptops, on the contrary, direct soldering of the processor contacts to the motherboard pads is more often used.

Using a socket on the PC motherboard makes it easy to remove and replace the processor without specialized tools if necessary. A processor may need to be replaced if it breaks down or to replace it with a more powerful one.

The sockets differ in size, number of contacts, type of connection, and mounting locations for the cooler and radiator. It is very important that the motherboard socket is the same as the socket of the processor installed on it, or compatible with it. There are sockets that look almost identical to each other, but they are not compatible. Trying to connect a processor to an incompatible socket on the motherboard may result in the death of the processor. In case you manage to insert the processor into an incompatible socket and you supply current.

Socket selection

The socket is an important detail that you should pay special attention to when choosing a motherboard. It is he who most often determines the quantity compatible with motherboard, processors. And the performance of the entire system depends on the selected processor.

In our time Computer techologies They become outdated quite quickly, so when choosing a motherboard, it makes sense to pay a little extra for the latest socket. This will give you a guarantee that in the next few years you will be able to improve your computer without any special financial costs.

The logic here is simple. For a certain period of time, processor manufacturers launch a conveyor line for the production of various processors for a specific socket. When developing new generations of processors, engineers also develop them for a certain socket for some time. For the end user, this means the following: having bought a motherboard with the latest socket and processor for it, in a few years it will be possible to install a more recent processor on the same motherboard.

Types of sockets

There are different types of sockets black, white, red. There are a lot of them. Each manufacturer has their own. And in general, if you go into such a jungle, you will need not an article, but an entire encyclopedia. It’s enough for us to know that the trend among new sockets is determined by the manufacturer’s 2 largest campaigns: AMD and Intel. The latest socket lines at the moment, and detailed description their advantages over older versions can be found on the manufacturers' websites. Also, as new technologies appear on the market, a bunch of comparative reviews. Read it if interested.

If you compare AMD and Intel, it is impossible to clearly determine the leader. Both companies have their advantages and disadvantages. Both are trying to win different market segments from each other, so trends change often. When choosing a processor and a socket for it, you should look at the situation at the moment.

Intel sockets

Intel processors most often turn out to be more productive and less voracious in terms of energy consumption + they heat up less. However, to achieve such results, they have to change sockets frequently. Intel sockets are not compatible with each other. Intel releases a new socket to the market almost every year. This makes upgrading your computer very difficult. To install a new processor from Intel, you have to buy a new motherboard with a new socket. Motherboards for the latest Intel socket are usually very expensive.


To modern Intel sockets can be attributed:

LGA 2011-3- who came to replace LGA 2011. Supports 20 MB L3 cache, up to 8 processor cores and RAM frequency up to 17000 MHz. It is also worth noting the presence of solder under the processor cover, which results in much better heat transfer to the radiator.

LGA 1150 and the more recent 1151 - processors on this socket, although inferior to socket 2011-3, still have good performance productivity. Processors on this socket are suitable even for serious gaming PCs.

LGA 2066- should replace socket 2011-3 in the 3rd quarter of 2017.

AMD sockets


AMD campaign sockets are compatible among related processors. Switching to a new socket less frequently allows you to upgrade your PC processor longer without having to replace the motherboard. This makes system upgrades much cheaper. However, there is a downside to this too. New technologies do not reach computers with AMD processors so quickly. For example, support for DDR4 memory is expected only at the beginning of 2017. AMD processors have 2 lines of sockets:

FM 2 / FM 2+- these sockets were designed to work with processors with built-in graphics modules. By eliminating the need for a video card, you can significantly reduce the cost of a PC. Such computers are not designed for gaming or working with heavy graphics, but they are quite enough for weak games and solving other everyday tasks.

AM 3 / AM 3+- these sockets replaced the AM2/AM2+ sockets. They are designed to work with low and high performance processors without a graphics core.

AM 4- new for 2016. This socket should replace the sockets AM3/AM3+. At the moment there are no processors with such a socket on sale, but their appearance is expected soon.

AMD Processor Compatibility Chart

Motherboard
AM2
Motherboard
AM2+
Motherboard
AM3
Motherboard
AM3+
Motherboard
FM1
Motherboard
FM2
Motherboard
FM2+
Processor AM2
Processor AM2+
Processor AM3
Processor AM3+
Processor FM1
Processor FM2
Processor FM2+

After the initial comparison, you must definitely check the presence of a specific processor model in the compatibility lists of the motherboard manufacturer.

The choice of socket is very important for the correct layout of the computer. For high-performance PCs, you should choose sockets for modern processors Intel. Both Intel and AMD sockets are suitable for the mid-segment. It all depends on the price. The favorites in this segment may change over time. When assembling budget PCs, you should pay attention to AMD. Their processors and motherboards are cheaper and upgrading them is inexpensive.

Within this review, I will tell you what a socket is, as well as some features.

Previously, computers were solid, the necessary microcircuits were soldered directly to the main board. Therefore, improvement at home was either extremely difficult or impossible. Nowadays, a computer requires the replacement of individual parts. For example, you can install more powerful processor, video card, add RAM and so on.

This became possible due to the fact that special connectors were added to the motherboard, one of which is a socket.

But first things first.

A socket is

Socket- This is a connector for connecting the processor to the motherboard. To give a life analogy, it’s like a wire plug and a socket in the wall.

Note: It's worth knowing that this term also used in programming. There, in a general sense, a socket means a software interface for data exchange.

As already mentioned, the main task of the socket is to provide the ability to easily replace parts or improve the performance of the computer. For example, if you need a more powerful processor, you don't need to change your computer completely. This approach significantly saves money and also extends the life of computers.

How are sockets different?

The most important thing that every user needs to know is that the sockets of the processor and motherboard must be the same, otherwise, at best, the computer will not start, and at worst, one of them will have to be changed. Basically, it’s like in life: shove usb cable into the network card port is not the best idea. But it’s still worth remembering this.

However, there are backwards compatible socket extensions, but they are very few. For example, a motherboard that supports socket AM3+ may allow you to connect processors with socket AM3 (you need to check the motherboard specification).

Physical differences between sockets:

1. The size itself. Width and height.

2. Number of contacts. Nowadays it is measured in hundreds and reaches 1000+. For example, socket AM4 has 1331 pins ( AMD processors), and LGA 2011 or Socket R (Intel server processors) have 2011 pins.

3. Type of contacts. Either with or without contact feet.

4. Cooler mounting distance. It would seem what a difference there could be in a cooling device. However, it exists due to the difference in width and length. Therefore, if you need a more powerful CPU cooler rather than a standard one, then you need to consider the socket.

Note: In principle, you can attach a cooler from another socket (their main task is heat removal), but it’s better not to do this.

Technological differences of sockets:

1. Power and performance. For example, old sockets, even if current processors are connected to them using a file, simply will not be able to handle such power.

2. Supported RAM . We are talking about the DDR type, supported frequencies and volume.

3. Various additional features. For example, does the socket support the possibility of an integrated video card in the processor.

Main socket lines

If we talk about common household appliances, including computers, the main lines of sockets are Intel and AMD. However, it is worth knowing that specialized devices, for example, powerful servers, can be equipped with other processor lines (Oracle, IBM, NVidia, and so on). It just so happened historically that in current time rulers 2.

Each of the lines implies division into specific sockets. Each individual socket typically supports a small set of processors. For example, AM3+ supports AMD processors FX-4100, FX-4300, FX-6100, FX-6300 and so on up to FX-9000. Socket H2 (LGA 1155) from Intel supports processors with Intel Sandy Bridge and Intel Ivy Bridge architecture (for example, Core i3/i5/i7 of certain models).

If we talk about qualities, the line from AMD is considered more budget-friendly and its processors are better for overclocking, but the line Intel processors consume less watts, are more stable and productive. Although, as they say, as many people as there are so many opinions.

I also advise you to read the review.