In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
There are only theories but no examples. The flow mechanism of unix is a wonderful mechanism, but how does unix flow be realized and used? although unix stream has been proposed for a long time, it has not been widely used today. except for operating systems such as solaris and windows, there are almost no systems using it. nowadays, there are only a few operating systems in the world, according to general classification. First, windows, then linux and several unix, such as solaris and various bsd and darvin, and then small princes, needless to mention, among several big ones, only windows and solaris absorb the stream ideas of unix, the rest seem to be the result of internal competition, do not care about the overall architecture, but only slightly better in details, such as reading the linux source code, you will find that there are very bad algorithms, but also very wonderful Obviously not by a group of people, each developer is going their own way, so they lose the overall beauty, and the result is the improvement of efficiency, which may be the beauty of GNU (although solaris10 and Microsoft's development framework are also open source, it is open source under different license, which is not the same as linux). Everyone can read a lot of materials to parse the beauty of stream from the windows kernel, but the stream implementation of unix itself can only provide an overview of the commercial unix implementation after system V. the most impressive one is solaris. Take the open*** I am familiar with as an example, when opening and initializing the tun/tap device, open*** will call open_tun and need to initialize the protocol stack of the entire virtual device, so linux and solaris go their separate ways in linux The implementation is as follows:
Void open_tun (...)
{
There is no need to say much about the implementation of linux, which essentially initializes the tun device of the kernel.
}
Because linux does not implement the flow mechanism of unix, linux simply calls the open routine of the virtual network card device and the ioctl routine of TUNSETIFF, and the result is nothing more than "directly" initializing the protocol stack of the virtual network card device for later use. Look at the implementation of solaris:
Void open_tun (...)
{
...
If (tt- > type = = DEV_TYPE_TAP) {
Ip_node = "/ dev/ip"
If (! dev_node)
Dev_node = "/ dev/tun"
...
}
...
If_fd = open (dev_node, O_RDWR, 0)
Ioctl (if_fd, I_PUSH, "ip")
...
}
Obviously, the way of solaris is better than linux, it directly "presses" the ip protocol on the virtual network card device, so it is equivalent to realizing the tcp/ip protocol stack of the virtual network card device, which can be pressed into not only the ip protocol module, but also all the protocol processing modules such as arp,icmp. The flow mechanism of unix can filter any IO data, and the key lies in the use of an I_PUSH/I_POP command parameter. How flexible and wonderful it is to accomplish such low-level protocol integration through ioctl in user space! The unix stream method does not need to initialize the entire protocol stack directly, but can initialize the reflow module when it is pressed into it.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.