352 | | === Monitoring your core network === |
353 | | |
354 | | Let's watch how the packets travel through the network. |
355 | | |
356 | | {{{ |
357 | | #!div style="background: #ffd; border: 3px ridge; width: 685px;" |
358 | | i. In a local terminal type: |
359 | | {{{ |
360 | | ssh -A top "tail -f /tmp/click.log" |
361 | | }}} |
362 | | }}} |
363 | | {{{ |
364 | | #!div style="background: #ddf; border: 2px ridge; width: 685px; margin-left:50px;" |
365 | | ii. Go to your window for '''hostA''', where your '''nc''' command is still running. Type a message into this window. You should see a log message in three of your four router windows. |
366 | | {{{ |
367 | | [mberman@hostb ~]$ nc -ul 24565 |
368 | | your message here |
369 | | }}} |
370 | | }}} |
371 | | {{{ |
372 | | #!div style="background: #ffd; border: 3px ridge; width: 685px;" |
373 | | iii. In the local terminal you will see: |
374 | | {{{ |
375 | | outR: 76 | 000423b7 192e0004 23b71ce0 7744416c 69636557 61734865 |
376 | | }}} |
377 | | This log entry says that the '''top''' router received a packet from '''hostA''', modified it, and sent it out to the '''right''' router. If the entry started with '''outL''', that would indicate that it sent the packet out to the '''left''' router. Let's look a bit at the start of the packet (the first 24 bytes are logged). It starts with an Ethernet header. The first six bytes are the MAC address of the destination interface, that's 00:04:23:B7:19:2E, the MAC address of '''eth4''' on '''right'''. The next six bytes are the MAC address of the source interface, 00:04:23:B7:1C:E0, or '''eth4''' on '''top'''. Next comes your ether type, 0x7744. The remaining bytes, "416c 69636557 61734865" are the start of the first field in your new protocol, "!AliceWasHe" in ASCII. |
378 | | }}} |
379 | | |
380 | | {{{ |
381 | | #!div style="background: #ddf; border: 2px ridge; width: 685px; margin-left:50px;" |
382 | | iv. Try typing a few different lines to '''hostA'''. |
383 | | }}} |
384 | | |
385 | | {{{ |
386 | | #!div style="background: #ffd; border: 3px ridge; width: 685px;" |
387 | | v. In the local terminal you should see some packets routed to the left and some to the right. |
388 | | }}} |
389 | | |
390 | | The routing decision is based on the '''route :: Classifier(27/01%01,-);''' entry in the '''top''' router configuration. Here, the router is looking at the low-order bit of the checksum on the initial IP packet (now at byte position 27 with the addition of the new sixteen byte field at the start of the header). Packets with odd checksums go to the left; those with even checksums go right. |
391 | | |