Sunday, February 28, 2010

TRACE then HEAD and GET

In a networking job you'll always get into a situation wherein somebody's going to complain about not being able to browse a site or some specific sites. It could be customers of your company or even users within the organization. What do you do when this happens? typically you would browse them by yourself (hopefully your not behind a proxy), then you find out your are able to browse the site. You ask them what troubleshooting steps has been done; where you able to ping the site? have your tried to do an nslookup? changed dns servers? have you tried browsing by IP address? used a public proxy server? tried changing your IP address, etc etc..but most likely, 99% of the time you'll ask them to perform a traceroute to the website. Generally a traceroute will be your most effective troubleshooting tool in these scenarios. It's like the basic swiss knife of troubleshooting routing issues and the likes. Though i know of a bit better one called 'pathping' (Windows only) but most of the time a traceroute will do the work. You'll see every hop, latency on each hop, and the path towards the destination. Probably the best thing you have to keep in mind in using this is that it's only the forward path to the destination. You don't ever see the reverse path unless you do a trace the other way..from the destination to the source. To make that even more challenging is that reverse paths can vary per hop. Imagine that every router always has their own best way around the Internet, and it is normal that every hop/router on the traceroute will have a different path back to the source of the traceroute, and that you don't see unless there something wrong with the trace like a huge spike on the latency where its not expected to.

As a start, traceroutes have different types. They vary on which type of packet they use. These are the most common ones i know: UDP, TCP and ICMP based traceroutes. UDP is the default for Linux, ICMP is the one that's used in Windows and TCP is a another variant which comes by default in Linux but is available for Windows as well as a free download over the net. Now these variants are pretty straight forward. In Linux, the default traceroute uses UDP packets. Most of the time this is fine however there are times that you will encounter target machines that just don't respond to UDP. Honestly there are a lot of them out there!

$traceroute hostname/IP address

Another variant is the ICMP based traceroute. In windows this is the default however it is more known as 'tracert'. By the name ICMP you would immediately know that it uses PING or echo requests as it goes through each hop along the path. So typically if you can ping it then it would respond, with some rare exceptions ofcourse due to firewalls and security policies put in place by organizations.

in Linux:

$traceroute -I hostname/IP address

in Windows:

C:\>tracert hostname/IP address

So basic stuff isn't it? Yes but the trick is knowing how and when to use them. Now probably the best one that I myself prefer. The TCP traceroute almost always does the job when finding out if you can really reach a site. The problem with ICMP and UDP is that not all routers respond to these type of packets. Specially ICMP since most modems nowadays are distributed with ICMP replies disabled as an anti denial of service mechanism. Some do respond but will drop packets every certain interval to prevent against ping floods. Many of them are just turned off since by just turning it on makes you vulnerable to OS fingerprinting. Each OS vendor has their own little tweak on their TCP/IP stack making them identifiable from each other. Redhat has their own, Windows has their own so you know which is which. Therefore attackers would already have a clue on how to attack. Knowing what type of OS and which version is it then what programs are installed, all these would be very important information for hackers around the net. So watch out for that ICMP unless there's nothing really important on your machine and you don't really care. LOL

A lot of times you will see that traceroutes will stop just right before the target machine. Most people will think - Oops there's a problem, i'm not able to reach the site i'm trying to access. Maybe that's why i can't browse that website.
Trust me this isn't always the case. Most of the time the target machine just doesn't respond to your requests. Since your trying to access a website. . hmmm.
http. .which is TCP port 80, then it would just make sense if you will use TCP packets to probe if the websites http port is accessible.

$tcptraceroute hostname/IP address [80]

Specifying the port is optional. The default is 80 and you may specify other ports e.g. SMTP, FTP, and so on. You'll now then see the target machine respond since you know that it's listening on TCP port 80. Almost every time you'll see a traceroute complete by using this. But there are times that servers/routers are just so secure they just don't respond to anything! even TCP. Maybe due to TCP SYN attacks? who knows. The point is they just stay stealth mode:)

These are the times that you may want to access the server head on. Try telnetting into the server.

$telnet hostname/IP addess 80

Yes trying to get inside the server to make sure you can access it. For secured sites use port 443. Now if it tells you your connected then that's it you proved that you can access the site. But wait. .sometimes there are underlying issues we must not fall for. These are the times that you would like to mimic your browser and send some server requests just to make sure you are indeed able to download the webpages. Why even bother? I was able to access the site via command line.

Since your already in the server why not try to see if you are able to download the page.

$telnet www.somesite.com 80
Connected to www.somesite.com.
HEAD / HTTP/1.0
press Enter/Return twice!

Texts in bold are the ones you will type.

example:



Passing a HEAD command to the server is sending an http request to download a resource (in this case '/') without actually downloading it. HTTP/1.0 is telling the server its an HTTP 1.0 request. Press Enter to end the request then you may type in some optional request headers then press Enter again to end. In our example we didn't so we just press Enter twice.

note: If you get the code "200 OK" that means it's all good! Also notice that the server told us that its using HTTP 1.1, you may also make your request as HTTP1.1 by using 1.1 instead of 1.0. See how much stuff you can get by this? It even tells you what type of web server it's using and what version. ASP.NET and what version, useful stuff for some:)

To actually download the webpage then you issue the GET command.
$telnet www.somesite.com 80
Connected to www.somesite.com.
GET / HTTP/1.0
press Enter/Return twice!


This is like actually doing what your browser is doing on the background when you're browsing a website. You will see the source of the page your trying to download by issuing this command. HTML stuff and javascript are common.

sample output:



All you will be able to catch really is just the end of the page because it just blurts it all out on you until it reaches that closing tag of the web page. But you wouldn't really mind because all that matters for us is to know its working!

Now question is why go all the way in doing this? Like what I said there are times that there are issues we do not see or might overlook. Doing these steps would make our troubleshooting much more concrete and will bring us to more accurate conclusions. What if there was an MTU issue along the path? How do you detect that? You send large pings as you can? Even if you do so on the direct gateway of the user its still not guaranteed he/she will be able to browse with the maximum mtu the end device is allowed to. Nothing beats the view from the source device so its always recommended to trust the tests more on their end rather than the tests you do from the middle of the network.

Now if there are routing issues everything i said in this post will be basically useless. Sometimes the source address can be blocked on the target site but that you will detect if traceroutes and telnet fails.

Surprisingly there is always a huge chance the destinaton hop would not be seen in a traceroute, but hey..as long as you are able to reach the last hop router then you can already guarantee there's no problem on your end. Remember that it's the last hop router's responsibility to route to that destination and that it must be a directly connected interface anyway so you're sure its going to route for that unless it's down. If it's not the last hop router then that's where you investigate for blocking or routing issues.

So then watch out for those browsing issues as they're always gonna be around. Understanding how they work and having the knowledge on how to troubleshoot them if they are not accessible through the browser will make things a lot easier for you:)

Monday, February 22, 2010

FAQs (Frequently Asked Questions)

Please feel free to add or let us know what you think that is wrong to this list by posting your comment below.

Q. How much are the Cisco exams?


CCNA
640-822 costs $125 each attempt.
640-816 costs $125 each attempt.
640-802 (combination for ICND1 and ICND2) costs $250 each attempt.

CCDA/CCNP/CCNP Wireless/CCVP/CCSP/CCDP
64x-??? costs $150 each attempt.

Some people are saying that the new exams for CCNP will be $200 each attempt.

CCNA concentrations (Voice/Security/Wireless)
Exams costs $250 each attempt.

CCDE/CCIE exams

CCIE written exam costs $350 each attempt.
CCIE lab exam costs $1,400 each attempt.

CCA (Cisco Certified Architect) exam costs $15K each attempt.

Now, there are some countries that charge tax on top of exam prices.

Q. Do you know where to get cheaper voucher for the Cisco exams?

Yes, just go here between 25th - 31st of the month and you will see discounted vouchers. Though, they usually sell the 640-822/816 every single day for $120 but they do sell it cheaper than that during those days that I have mentioned above. There was a time where they were selling the voucher for $75, that's 40% off the original price! Just make sure you're buying the International voucher if you're outside USA/Canada.

Q. Do I need credit card to purchase the voucher?

If you buy it from Vue directly then yes. If you buy it from the site mentioned above then you have the option to pay credit card or PayPal.

In the Philippines, you can call the testing center and ask them to register for you. Once you arrived at the testing center, you can pay the exam fee by cash. Choosing this option will probably cost more than using your credit card.

Q. Is the site above legit?

Of course it is! I won't put it here if it wasn't legit. I have bought three vouchers from them and will continually do so for the next exams that I will be taking.

Q. Are you getting paid to advertise them?

We are not getting paid for this. We are just trying to help you save money!

Q. Where can I take CCNA exam?

Click here and it will tell you the answer. Now, if you're from the Philippines then there are some suggestions that I've read from the thread. MISnet (Makati City) and Database Wizard Inc. (Makati City) are the recommended testing centers.

Q. Can I reschedule my exam?

Yes, you can. If you register the exam from Vue's site then you can do it online. If not, then call the testing center at least 24 hours before your exam date and time or more just to be in the safe side.

Q. What do you recommend self study, CNAP (Cisco Network Academy Program), or bootcamp?

Team members of Bandwidth Bandits will have different opinion about this.

CNAP has its benefits. One of the benefits is access to real equipment and it is an instructor-led training. The materials that are posted from their website are laid out very well. Some, if not all, instructors have been teaching the material for so long so they know the material well enough. Another benefit is access to a special link to avail discounted Cisco Press books up to 45% off. Well, some people do not buy hardcopies anymore because of piracy so that is not a benefit for people that supports piracy. Another benefit is access to Packet Tracer application provided to students and alumni. Again, this may not be viewed as advantage because of piracy. Another benefit I can think of is the discounted voucher if you pass the lab exam. They will give you more than 50% off the exam price if you pass the lab exams. When I was enrolled in CNAP for CCNA, there were only two lab exams. These were easy exams if you've been doing your labs. These vouchers are only for CCNA by the way. Disadvantage of CNAP, it takes three to four semester to finish the CCNA curriculum.

Bootcamp is an instructor-led 5-day or 7-day training. They teach you the materials for short amount of time. You will also have access to real equipment to play with. Some companies will pay for this type of training because they are really expensive. Here in the USA, bootcamps price are ranging from $2K - $5K, depending on which subject. From what I have heard, bootcamps in the Philippines are cheaper than CNAP. Here in the USA, it is the other way around. Community colleges and even high schools are offering CNAP classes and range from $60 - $1K. Normally though, it is less than $300 for one class. When I took my CCNA 1 - 4 from CNAP, I paid about $200 for three semesters in California. When I took my BCMSN class last year here in Illinois, I paid almost $400 for the class. I would've paid almost $1K if I didn't know how to get the discounted rate. Disadvantage of bootcamp is the fast-paced training. Normally, you can't retain all that information crammed to your brain in such a short week.

Self study is the cheapest option out of the three. With what is happening to our world (recession) it is what most, if not all, people are doing. If you take this path, make sure to buy CBT Nuggets or Train Signal materials to help on some of the topics you may have a hard time with.

Q. Which school should I enroll to?

My friend went to Meralco Foundation and he seems to know his stuff. Some suggest University of the Philippines, Mapua, and DLSU. One of the team members of Bandwidth Bandits (Prime) suggests CNCTC.

Q. Which book should I get?

Any Cisco Press books is fine. However, I've been reading comments of other people that Todd Lammle's CCNA book is really good.

Q. What is the passing score in Cisco exams?

Well, you'll see it when you take the exam. It'll let you know how much points you need to accumulate to pass the exam. The maximum points that you can get is 1000. For CCNA, unless they change the passing score, it is 849 out of 1000.

Q. I want to build a home lab, what routers and switches do I need to buy?

Click here.

Q. I do not have money to spend for a home lab, what should I do?

You can use simulator. Boson is selling simulator. Some books come with simulator for free. You can use Packet Tracer. You can use GNS3 or Dynagen/Dynamips. These two require you to use Cisco IOS. To legally use an IOS, you need to buy the license. However, the EULA may state that you are only supposed to run it on Cisco hardware so it may be a violation.

Q. Who can teach me about subnetting?

Click here.

Q. How to check my subnetting answers?

Click here.

Q. I heard about CCNP changes, should I take the old curriculum or the new one?

If you can pass the exam(s) by July 31st then by all means take the old curriculum. However, make sure you pass the most important ones first, BSCI and BCMSN. These two exams will be counted towards the new CCNP curriculum. ONT and ISCW won't be counted at all. The new exams consists of ROUTE, SWITCH, and TSHOOT. More info here.

Q. How do I renew my Cisco certification(s)?

It really depends on which certification you're trying to renew. Please click here for more details.

Q. Do Cisco certifications expire?

Yes, every three years.

Q. I let my Cisco certification expired, how can I renew it?

Well, once it is expired then you won't be able to renew it, per se. You need to pass all the exams again starting from CCNA.

Q. I noticed that CCNA Voice is $250 and CVOICE is only $150, should I take CCNA Voice or straight to CVOICE?

I honestly think you should just skip CCNA Voice because of the price. Though, I suggest you to read the book because there are some information there that are important as a VoIP Engineer. Pass the CVOICE and you'll be CCNA Voice.

Q. What are the right combination for the CCNP exam?

BSCI + BCMSN + ONT + ISCW = CCNP <-- All exams should be passed by July 31st BSCI + BCMSN + TSHOOT = CCNP ROUTE + BCMSN + TSHOOT = CCNP BSCI + SWITCH + TSHOOT = CCNP ROUTE + SWITCH + TSHOOT = CCNP

Q. Where can I buy Cisco books?


You can buy them from Powerbooks, National Bookstore, or DataBlitz. You can also try ordering from Cisco Press or Amazon.

Saturday, February 20, 2010

Let’s get physical!

Let me start by saying that I do not hold any Cisco Certifications but I believe that I have the necessary experience in playing around with their devices to make this post.

Cisco networking devices has been the de-facto standard for small business to enterprise networks. It’s one of those devices where all you need to do is set it up for the first time securely, and it will continue to work as long as no one physically or virtually attacks it.

It has been a habit of mine to implement security in layers when building up networks from the ground up. My signature I guess will be a Master Lock, and it comes with a set of four. This is the first line of defense before you can access my rack or server cabinet. I usually rotate the four Master Locks randomly every two weeks, sometimes weekly. The randomness adds salt to the hash, like in cryptography. The cables are usually wrapped and inside EMI and RFI shielded pipes. No loose wires here man, and I make sure the contractors we hire to do our wiring signs a NDA for client infrastructure materials used during the buildup. Oh yes, we do have a couple of shielded walls as well, especially the ones around the server rack itself. This is for emission and transmission security for those nasty sniffers out there, like me.

Traditional CCTVS are all over the place of course. Most of the guys are migrating already to IP-Based CCTV’s but I find it inherently flawed when it comes to security simply because of one factor; it runs on IP.

(To be continued on next post. Need to go the San Francisco, Market Street, Old Navy is on sale, you can’t miss that  )