Networking Basics This section introduces the basics of
Networking Basics This section introduces the basics of networking in OpenBSD and some tools you need to be able to work well with it. Some parts are common to all sorts of TCP/ IP networks, such as IP addresses. Others are specific to BSD-based operating systems, such as mbufs. The power offered by OpenBSD requires more understanding than that needed to run a point-and-click operating system. Mbufs OpenBSD optimizes networking by using mbufs. An mbuf is a discrete chunk of kernel memory set aside for networking. A packet starts off life as a mbuf. Rather than copying the contents of a packet to the next network layer, each layer passes around a pointer to the mbuf. Copying the data consumes far more time and resources than simply handing off responsibility for the data while leaving the data itself in the same spot. Mbufs are carefully designed to not require dramatic changes. When the logical protocol creates an mbuf, it leaves space at the front and back for physical protocol headers, which further minimizes the amount of copying required. A packet becomes a frame within the same mbuf. Those of you who are C programmers should recognize a pointer here. The pointer to the mbuf is handed around, while the mbuf itself remains constant. The rest of us just need to have a basic idea of what an mbuf is. You’ll keep tripping across mentions of mbufs throughout documentation on the OpenBSD network stack, so it’s important to at least have a vague awareness of them. How Many Mbufs? Each kernel allocates a certain number of mbufs. When you run out of mbufs, you can’t push more data. This raises the obvious questions: How many mbufs do you have, and how can you get more? The netstat(1) command is a general interface into the network stack. It has many functions that are wildly different. While this is definitely a deviation from the UNIX philosophy of “small tools that each do one thing well,” netstat has been this way for so long that nobody’s really inclined to change it. The “-m” flag to netstat gives some basic mbuf information. # netstat -m 1 18 mbufs in use: 2 1 mbuf allocated to packet headers 17 mbufs allocated to socket names and addresses 0/12 mapped pages in use 36 Kbytes allocated to network 3 (12% in use) 0 requests for memory denied 0 requests for memory delayed 0 calls to protocol drain routines # Here, we see 1 how many mbufs have been used and 2 what part of the network they’re being used for. We also can see 3 how much of the kernel memory reserved for network operations is in use. This particular system has lots of kernel memory left and is using very few mbufs. The number of mbufs a system has is controlled by the NMBCLUSTERS kernel option. Changing this requires patching your kernel. Take a look at Chapter 11 for some discussion of what this implies. Generally speaking, your system will complain if it starts running out of mbufs; you will see “mclpool limit reached” messages on the console and in /var/log/messages. Bits As a systems administrator, you’re going to start seeing terms like 32-bit and 48-bit more and more frequently. Too many sysadmins just nod and smile when they see these terms, but don’t really understand what they mean. If you’re running OpenBSD, that means you have an interest in security, Page 163
Note: If you are looking for top 10 and very good webhost to host and run your jsp application check Actions jsp hosting services