diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /1163/CH2 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '1163/CH2')
-rwxr-xr-x | 1163/CH2/EX2.1/example_2_1.sce | 66 | ||||
-rwxr-xr-x | 1163/CH2/EX2.1/fig_2_1.jpg | bin | 0 -> 48413 bytes | |||
-rwxr-xr-x | 1163/CH2/EX2.2/example_2_2.sce | 5 | ||||
-rwxr-xr-x | 1163/CH2/EX2.3/example_2_3.sce | 9 | ||||
-rwxr-xr-x | 1163/CH2/EX2.4/example_2_4.sce | 100 | ||||
-rwxr-xr-x | 1163/CH2/EX2.4/fig_2_4.jpg | bin | 0 -> 75927 bytes | |||
-rwxr-xr-x | 1163/CH2/EX2.5/example_2_5.sce | 4 |
7 files changed, 184 insertions, 0 deletions
diff --git a/1163/CH2/EX2.1/example_2_1.sce b/1163/CH2/EX2.1/example_2_1.sce new file mode 100755 index 000000000..9e3312105 --- /dev/null +++ b/1163/CH2/EX2.1/example_2_1.sce @@ -0,0 +1,66 @@ +clear;
+clc;
+disp("--------------Example 2.1---------------")
+// example explanation
+printf("A node with physical address 10 sends a frame to a node with physical address 87. The two nodes are connected by a link (bus topology LAN).\nAt the data link layer, this frame contains physical (link) addresses in the header.The trailer contains extra bits needed for error detection.\nThe computer with physical address 10 is the sender, and the computer with physical address 87 is the receiver.\nThe header, among other pieces of information, carries the receiver and the sender physical (link) The destination address, 87 comes \nbefore the source address 10. In a bus topology, the frame is propagated in both directions (left and right). The frame propagated\nto the left dies when it reaches the end of the cable if the cable end is terminated appropriately. The frame propagated to the right is sent\nto every station on the network. Each station with a physical addresses other than 87 drops the frame because the destination address in the frame\ndoes not match its own physical address. The intended destination computer, however, finds a match between the destination address\nin the frame and its own physical address. The frame is checked, the header and trailer are dropped, and the data part is decapsulated and\ndelivered to the upper layer.");
+sender_address="10";
+reciever_address="87";
+clf();
+xname("--------------Example 2.1----------------");
+// display the figure
+xset("thickness",2.5);
+xpoly([.049 .86],[.48 .48]);
+xpoly ([.35 .35],[.73 .48]);
+xpoly ([.55 .55],[.73 .48]);
+xset("thickness",1);
+xset("font size",2);
+xstring(.36,.6,"Destination address does not");
+xstring(.36,.56,"match;the packet is dropped");
+xstring(.25,.63,"Trailer");
+xstring(.001,.63,"Destination address");
+xstring(.001,.5,"Source address");
+xpoly([.1 .11],[.52 .55]);
+xpoly([.22 .25],[.6 .63]);
+xpoly([.05 .08],[.63 .6]);
+xset("font size",4);
+xstring(0.1,.75,["10 - Sender"]);
+xstring(0.7,.75,["87 - Reciever"]);
+xstring(.32,.75,"Station 28");
+xstring(.52, .75,"Station 53");
+xstring(.44,.42,"LAN");
+xrect(.13,.7,.07,.05);
+xstringb(.13,.65,["Data"],.07,.05);
+xrect(.73,.7,.07,.05);
+xstringb(.73,.65,["Data"],.07,.05);
+xrects([ 0.07 .13 .2;.6 .6 .6;.06 .07 .03;.06 .06 .06]);
+xstring(0.07,.55,["87"]);
+xstring(0.1,.55,["10"]);
+xstring(0.2,.55,"T2");
+xrect(.135,.595,.06,.05);
+xstring(.137,.555,["Data"]);
+xstring(0.67,.55,["87"]);
+xstring(0.7,.55,["10"]);
+xstring(.8,.55,"T2");
+xrect(.735,.595,.06,.05);
+xstring(.737,.555,["Data"]);
+xset("font size",6);
+xstring(.43,.51,". . .");
+xfrect(.009,.5,.04,.05);
+xfrect(.86,.5,.04,.05);
+xpoly([.17 .17],[.75 .7]);
+xpoly([.77 .77],[.75 .7]);
+xpoly([.17 .17],[.65 .6]);
+xpoly([.77 .77],[.65 .6]);
+xpoly([.17 .17],[.54 .48]);
+xpoly([.77 .77],[.54 .48]);
+xarrows([.74 .8],[.45 .45],.5);
+xarrows([.76 .76],[.45 .54],.5);
+xarrows([.34 .4],[.45 .45],.5);
+xarrows([.36 .36],[.45 .57],.5);
+xarrows([.54 .6],[.45 .45],.5);
+xarrows([.56 .56],[.45 .57],.5);
+xarrows([.14 .2],[.45 .45],.5);
+xarrows([.14 .08],[.45 .45],.5);
+xpoly([.16 .16],[.45 .54]);
+xset("line style",2);
+xrects([.67 .73 .8;.6 .6 .6;.06 .07 .03;.06 .06 .06]);
diff --git a/1163/CH2/EX2.1/fig_2_1.jpg b/1163/CH2/EX2.1/fig_2_1.jpg Binary files differnew file mode 100755 index 000000000..301b3a172 --- /dev/null +++ b/1163/CH2/EX2.1/fig_2_1.jpg diff --git a/1163/CH2/EX2.2/example_2_2.sce b/1163/CH2/EX2.2/example_2_2.sce new file mode 100755 index 000000000..9cc3b2ea4 --- /dev/null +++ b/1163/CH2/EX2.2/example_2_2.sce @@ -0,0 +1,5 @@ +clear;
+clc;
+disp("--------------Example 2.2---------------")
+disp("07:01:02:01:2C:4B ") //display the example
+printf("This is an example of a 6-byte (12 hexadecimal digits) physical address.")
diff --git a/1163/CH2/EX2.3/example_2_3.sce b/1163/CH2/EX2.3/example_2_3.sce new file mode 100755 index 000000000..c2a01c1db --- /dev/null +++ b/1163/CH2/EX2.3/example_2_3.sce @@ -0,0 +1,9 @@ +clear;
+clc;
+disp("--------------Example 2.3---------------")
+// display the example
+printf("Each device(computer or router) has a pair of addresses (logical and physical) for each connection. In this\ncase, each computer is connected to only one link and therefore has only one pair of addresses. Each router,\nhowever, is connected to three networks . So each router has three pairs of addresses,one for each\nconnection. Although it may obvious that each router must have a separate physical address for each connection,\n;it may not be obvious why it needs a logical address for each connection.");
+printf("\n\nIn this example,the computer with logical address A and physical address 10 needs to send a packet to\nthe computer with logical address P and physical address 95. The sender encapsulates its data\nin a packet at the network layer and adds two logical addresses (A and P). The logical source address comes before the logical destination address .\nThe network layer, however, needs to find the physical address of the next hop before the packet can be\ndelivered. The network layer consults its routing table and finds the logical address of the next hop (router 1) to be F.\nThe ARP finds the physical address of router 1 that corresponds to the logical address of 20. Now the network layer passes\nthis address to the data link layer, which in turn, encapsulates the packet with physical destination address 20 and physical source address 10.\n\n");
+printf("The frame is received by every device on LAN 1, but is discarded by all except router 1, which finds that\nthe destination physical address in the frame matches with its own physical address. The router decapsulates the\npacket from the frame to read the logical destination address P. Since the logical destination address does not match the\nrouters logical address, the router knows that the packet needs to be forwarded. The router consults its routing table\nand ARP to find the physical destination address of the next hop (router 2), creates a new frame, encapsulates the packet, and sends it to router 2.\n\n");
+printf("The source physical address changes from 10 to 99. The destination physical address changes from 20 (router 1 physical address) to 33\n(router 2 physical address). The logical source and destination addresses must remain the same; otherwise the packet will be lost.\n\n");
+printf("At router 2 we have a similar scenario. The physical addresses are changed, and a new frame is sent to the destination computer.\nWhen the frame reaches the destination, the packet is decapsulated. The destination logical address P matches the logical address\nof the computer. The data are decapsulated from the packet and delivered to the upper layer.")
\ No newline at end of file diff --git a/1163/CH2/EX2.4/example_2_4.sce b/1163/CH2/EX2.4/example_2_4.sce new file mode 100755 index 000000000..5d793adf7 --- /dev/null +++ b/1163/CH2/EX2.4/example_2_4.sce @@ -0,0 +1,100 @@ +clear;
+clc;
+clf();
+xname("--------------Example 2.4----------------");
+// display the figure
+xset("color",0);
+xset("font size",3);
+xrect(-.05,1,.09,.09);
+xrect(0.06,1,.09,.09);
+xrect(0.17,1,.09,.09);
+xrect(0.72,1,.09,.09);
+xrect(0.83,1,.09,.09);
+xstring(-.02,1,["a"]);
+xstring(0.09,1,["b"]);
+xstring(.20,1,["c"]);
+xstring(.75,1,["j"]);
+xstring(.86,1,["k"]);
+xstring(0.06,.75,["A - Sender"]);
+xstring(0.8,.75,["P - Reciever"]);
+xrect(.06,.7,.07,.05);
+xstringb(.06,.65,["Data"],.07,.05);
+xrect(.8,.7,.07,.05);
+xstringb(.8,.65,["Data"],.07,.05);
+xstring(.13,.65,["----------------------------------------------------Application Layer------------------------------------------------"])
+xrects([ 0 .03 .06;.6 .6 .6;.03 .03 .07;.06 .06 .06]);
+xrects([.74 .77 .80;.6 .6 .6;.03 .03 .07;.06 .06 .06]);
+xstring(0.005,.55,["a"]);
+xstring(0.035,.55,["j"]);
+xrect(.065,.595,.06,.05);
+xstring(.074,.555,["Data"]);
+xstring(0.745,.55,["a"]);
+xstring(0.775,.55,["j"]);
+xrect(.805,.595,.06,.05);
+xstring(.82,.555,["Data"]);
+xstring(.13,.55,["---------------------------------------------------Transport Layer----------------------------------------"])
+xrect(-.06,.465,.19,.065);
+xrect(.68,.465,.19,.065);
+xrects([ -.06 -.03 0;.47 .47 .47;.03 .03 .13;.06 .06 .06]);
+xrects([.68 .71 .74;.47 .47 .47;.03 .03 .13;.06 .06 .06]);
+xrects([ 0 .03 .06;.46 .46 .46;.03 .03 .07;.057 .057 .057]);
+xrects([.74 .77 .80;.46 .46 .46;.03 .03 .07;.057 .057 .057]);
+xstring(0.005,.41,["a"]);
+xstring(0.035,.41,["j"]);
+xrect(.065,.455,.06,.05);
+xstring(.074,.415,["Data"]);
+xstring(0.745,.41,["a"]);
+xstring(0.775,.41,["j"]);
+xrect(.805,.455,.06,.05);
+xstring(.82,.415,["Data"]);
+xstring(-.055,.42,["A"]);
+xstring(-.02,.42,["P"]);
+xstring(.69,.42,["A"]);
+xstring(.72, .42,["P"]);
+xstring(.13,.42,["---------------------------------------------Network Layer-------------------------------------"]);
+xrect(-.06,.305,.19,.075);
+xrect(.68,.305,.19,.075);
+xrects([ -.06 -.03 0;.3 .3 .3;.03 .03 .13;.06 .06 .06]);
+xrects([.68 .71 .74;.3 .3 .3;.03 .03 .13;.06 .06 .06]);
+xrects([ 0 .03 .06;.297 .297 .297;.03 .03 .07;.057 .057 .057]);
+xrects([.74 .77 .80;.297 .297 .297;.03 .03 .07;.057 .057 .057]);
+xstring(0.005,.24,["a"]);
+xstring(0.035,.24,["j"]);
+xrect(.065,.29,.06,.05);
+xstring(.074,.245,["Data"]);
+xstring(0.745,.24,["a"]);
+xstring(0.775,.24,["j"]);
+xrect(.805,.29,.06,.05);
+xstring(.82,.245,["Data"]);
+xstring(-.055,.25,["A"]);
+xstring(-.02,.25,["P"]);
+xstring(.69,.25,["A"]);
+xstring(.72, .25,["P"]);
+xset("color",2);
+xfrect(-.09,.305,.03,.075);
+xfrect(.65,.305,.03,.075);
+xfrect(.13,.305,.03,.075);
+xfrect(.87,.305,.03,.075);
+xstring(-.087,.24,["H2"]);
+xstring(.13,.24,["T2"]);
+xstring(.655,.24,["H2"]);
+xstring(.87,.24,["T2"]);
+xstring(.155,.26,["--------------------------------------Data link Layer---------------------------------"]);
+xset("color",0);
+xstring(.38,.05,["Internet"]);
+xarc(0.3,.15,.2,.2,0,360*64);
+xpoly([0.09,0.09],[.75,.7]);
+xpoly([0.09,0.09],[.65,.6]);
+xpoly([0.09,0.09],[.54,.47]);
+xpoly([0.09,0.09],[.4,.3]);
+xarrows([0.1,.3],[.23 .08]);
+xpoly([0.84,0.84],[.75,.7]);
+xpoly([0.84,0.84],[.65,.6]);
+xpoly([0.84,0.84],[.54,.47]);
+xpoly([0.84,0.84],[.4,.3]);
+xpoly([.5 .8],[.08 .23]);
+xpoly([-.02 .06],[.91 0.77]);
+xarrows([.82 .75],[.77 0.91]);
+disp("--------------Example 2.4----------------")
+// display the text
+printf("Figure shows two computers communicating via the Internet. The sending computer is running three processes at\nthis time with port addresses a, b, and c. The receiving computer is running two processes at this time with port addresses j and k.\nProcess a in the sending computer needs to communicate with process j in the receiving computer.\nNote that although both computers are using the same application, FTP, the port addresses are different because one is a client\nprogram and the other is a server program . To show that data from process a need to be delivered to process j, and not k,\nthe transport layer encapsulates data from the application layer in a packet and adds two port addresses (a and j), source and destination.\nThe packet from the transport layer is then encapsulated in another packet at the network layer with logical source and\ndestination addresses (A and P). Finally, this packet is encapsulated in a frame with the physical source and destination addresses of the next\nhop. We have not shown the physical addresses because they change from hop to hop inside the cloud designated as the Internet. Note\nthat although physical addresses change from hop to hop, logical and port\naddresses remain the same from the source to destination.");
diff --git a/1163/CH2/EX2.4/fig_2_4.jpg b/1163/CH2/EX2.4/fig_2_4.jpg Binary files differnew file mode 100755 index 000000000..293ef91a4 --- /dev/null +++ b/1163/CH2/EX2.4/fig_2_4.jpg diff --git a/1163/CH2/EX2.5/example_2_5.sce b/1163/CH2/EX2.5/example_2_5.sce new file mode 100755 index 000000000..36a580d16 --- /dev/null +++ b/1163/CH2/EX2.5/example_2_5.sce @@ -0,0 +1,4 @@ +clear;
+clc;
+disp("--------------Example 2.5---------------")
+disp("753 - A 16-bit port address represented as one single decimal number.")
|