Viewing network socket data is something SysAdmins do often. We could be called on to see if a connection is established to a host, if an application is listening on a given port, or we may need to review the network connection table as a whole to see what a server is doing (this is especially valuable when DDOS attacks occur). The netstat and lsof tools provide quite a bit of visibility into this area, but I’ve recently started firing up the ss (socket stat) tool when I need to view socket information. Socket stat can display pretty much everything you ever wanted to know about the connections on your server. To get a basic breakdown of ports that applications are listening on, you can run ss with the “-l” option:
$ ss -l
Recv-Q Send-Q Local Address:Port Peer Address:Port
0 128 :::ssh :::*
0 128 *:ssh *:*
0 128 127.0.0.1:ipp *:*
0 128 ::1:ipp :::*
To view the processes that are using each listening socket, you can run ss with the “-p” option:
$ ss -p
State Recv-Q Send-Q Local Address:Port Peer Address:Port
CLOSE-WAIT 1 0 192.168.1.1:57666 192.168.1.2:http users:(("gvfsd-http",16992,14))
To display the amount of memory being consumed by the socket buffers, you can use the ss “-m” option (this is quite handy!):
$ ss -e -m
State Recv-Q Send-Q Local Address:Port Peer Address:Port
CLOSE-WAIT 1 0 192.168.1.1:57666 192.168.1.2:http uid:500 ino:40834026 sk:ffff88022d3b2080
mem:(r360,w0,f3736,t0)
Additionally, you can use the ss “-s” option to summarize all of the socket states:
$ ss -s
Total: 571 (kernel 589)
TCP: 17 (estab 10, closed 0, orphaned 0, synrecv 0, timewait 0/0), ports 0
Transport Total IP IPv6
589 - -
RAW 0 0 0
UDP 10 6 4
TCP 17 14 3
INET 27 20 7
FRAG 0 0 0
There are also options to display information about specific socket types (UNIX domain, UDP, TCP, etc), and to dig deep into the connection table information (see the “-i” option for further details). If you have a current release of CentOS, RHEL or Fedora, this awesome tool should be on your system. It’s part of the iproute package.
There are currently two main NFS protocol versions in mainstream use. The first is version 3, which was introduced in 1995 as part of RFC 1813. NFSv3 implementations use separate daemons to implement the locking (rpc.lockd), status (rpc.statd), mount (rpc.mountd) and port assignments (portmap) features required by the protocol. NFSv4, which was introduced in 2003 as part ofRFC 3530, takes a different approach. The locking and stat functions are now part of the core NFS implementation, so you no longer need to ensure that the portmap, rpc.lockd and rpc.statd daemons are running on your Linux NFSv4 clients and servers. There is a blurb regarding this in the Redhat Linux 5.5 administration guide:
“Because protocol support has been incorporated into the v4 protocol, NFSv4 has no interaction with the portmap, rpc.lockd, and rpc.statd daemons. NFSv4 listens on the well-known TCP port 2049, which eliminates the need for portmap interaction. The mounting and locking protocols have been incorporated into the V4 protocol which eliminates the need for interaction with rpc.lockd and rpc.statd. The rpc.mountd daemon is still required on the server, but is not involved in any over-the-wire operations.”
This is an interesting tidbit that I wasn’t aware of, and I’m learning a lot of new things as I dig through some of the NFS implementation details. If you are interested in learning how NFS truly works, check out the NFSv3 and NFSv4 RFCs! You will be glad you did!!
I mentioned previously that I picked up an Android phone a few weeks back. As typical geek, I have been on a quest to outfit my phone with some killer applications, and to make my phone use a truly awesome experience. I’ve tested dozens and dozens of applications, and thought I would share my favourites here:
There are dozens of other awesome applications available in the Google market, and I would love to get your thoughts on cool applications that aren’t listed above.
I have been trying to eat better, and am trying a variety of different things to get into a routine of healthy eating (this is super hard to do when you lived off of junk food for as long as I have!). As part of my new eating habits, I have been trying to incorporate more greens into my daily diet. One great way I have found for consuming greens (and the chlorophyl they contain) is by juicing wheatgrass. You may have seen people ordering wheatgrass shots at your favorite health foods store, and paying $3 - $4 for a shot of juice! That is absurd, given that you can make a serving of wheatgrass juice for a few pennies.
To get started making low cost wheatgrass juice, you will first need to pick up a juicer. I really dig the Hurricane Stainless Steel Manual Wheatgrass Juicer I purchased through Amazon, but you can use whatever juicer you have available (manual juicers are the way to go IMHO!). Once you have a good juicer, you need to find a good source of wheatgrass. You can purchase a grow your own wheatgrass kit from a variety of places, or you can head down to your favorite health food store and get a bag of wheatgrass for a couple of dollars. The bag of wheatgrass should last you for quite some time if stored properly, though you will get the most out of your wheatgrass if you consume it shortly after purchasing it.
Making your wheatgrass juice is a snap. Set up your juicer, clean the wheatgrass you plan to juice, and then stuff it in the top of the juicer andwatch the delicious healthy green stuff spit out the side of the juicer. Now some people don’t care for the raw taste of wheatgrass. A number of recipes online recommend mixing it with your favorite juice beverages, especially ones that you make by hand. If you are new to juicing, you may want to check out The Wheatgrass Book as well as The Juiceman’s Power of Juicing. I learned a ton by reading each book, and have thoroughly enjoyed the delicious concoctions I’ve turned out! If you are an avid juicer, please leave me a comment. We can become juice buddies. :)
After months and months of research, I finally broke down a few weeks ago and purchased a smart phone. When I first decided to replace my aging Motorola RAZR, I wanted something that didn’t cost a fortune and provided a basic ‘net experience when i was away from my Mac. After playing around with a number of phones, I narrowed my choices down to theApple iPhone, the Motorola DROID and the Sprint EVO. I went back and forth for weeks, but decided to purchase a Sprint EVO for a couple of reasons:
So far I have been extremely happy with my purchase, though all of the complaints about EVO battery life are spot on (mine lasts for 4 hours with continuous use). I have to keep a charger at home, one in my car and another at my desk. This is kinda annoying, but I’m hopeful Sprint will issue an update to address this limitation. Battery issues aside, you really can’t go wrong with the Sprint EVO. Great phone!