Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(39)

Issue 5654053: Patch that adds tcp-echo helper, testsuit, example, and so on

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 3 months ago by frankhelbert
Modified:
10 years, 3 months ago
CC:
ns-3-reviews_googlegroups.com
Visibility:
Public.

Description

Patch that adds tcp-echo helper, testsuit, example, and so on. With IPv6 support. We've done a helper. We added some files under src/applications/model: tcp-echo-client.cc tcp-echo-client.h tcp-echo-server.cc tcp-echo-server.h Under src/applications/helper: tcp-echo-helper.cc tcp-echo-helper.h Under src/applications/test: tcp-echo-test-suite.cc Under examples/tcp: tcp-echo-example.cc Added some code to files address-utils.cc and address-utils.h to print Ipv4 and Ipv6 address easily (in human readable form), without the need to test what kind of address they are. Simple to use, just cast the address to AddressPrinter and ready. Example: NS_LOG_INFO ("Received " << packet->GetSize () << " bytes from " << (AddressPrinter)from); It doesn't matter of what type is the variable "from", if it is Ipv4Address, Ipv6Address, Address, InetSocketAddress, Inet6SocketAddress, it will print fine. I think it will save many if's from source.

Patch Set 1 #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+1579 lines, -1 line) Patch
A examples/tcp/tcp-echo-example.cc View 1 chunk +149 lines, -0 lines 6 comments Download
M examples/tcp/wscript View 1 chunk +4 lines, -0 lines 0 comments Download
A src/applications/helper/tcp-echo-helper.h View 1 chunk +217 lines, -0 lines 1 comment Download
A src/applications/helper/tcp-echo-helper.cc View 1 chunk +158 lines, -0 lines 0 comments Download
A src/applications/model/tcp-echo-client.h View 1 chunk +166 lines, -0 lines 1 comment Download
A src/applications/model/tcp-echo-client.cc View 1 chunk +332 lines, -0 lines 2 comments Download
A src/applications/model/tcp-echo-server.h View 1 chunk +97 lines, -0 lines 1 comment Download
A src/applications/model/tcp-echo-server.cc View 1 chunk +171 lines, -0 lines 1 comment Download
A src/applications/test/tcp-echo-test-suite.cc View 1 chunk +181 lines, -0 lines 1 comment Download
M src/applications/wscript View 4 chunks +7 lines, -0 lines 0 comments Download
M src/network/utils/address-utils.h View 3 chunks +35 lines, -0 lines 0 comments Download
M src/network/utils/address-utils.cc View 2 chunks +62 lines, -1 line 1 comment Download

Messages

Total messages: 1
Tommaso Pecorella
10 years, 3 months ago (2012-02-10 23:35:48 UTC) #1
Hi,

here is a first round of comments. In general, all the files don't contain much
problems, as they're an adaptation of the corresponding UDP echo.

Still, some minor stuff :)

Cheers,

T.

http://codereview.appspot.com/5654053/diff/1/examples/tcp/tcp-echo-example.cc
File examples/tcp/tcp-echo-example.cc (right):

http://codereview.appspot.com/5654053/diff/1/examples/tcp/tcp-echo-example.cc...
examples/tcp/tcp-echo-example.cc:36: //   |    10.1.1.1    |    |    10.1.1.2   
|
Use a generic IPv4 / IPv6 label here

http://codereview.appspot.com/5654053/diff/1/examples/tcp/tcp-echo-example.cc...
examples/tcp/tcp-echo-example.cc:112: ipv6.NewNetwork ("2001:0000:f00d:cafe::",
64);
LOL, good choice !

http://codereview.appspot.com/5654053/diff/1/examples/tcp/tcp-echo-example.cc...
examples/tcp/tcp-echo-example.cc:114: serverAddress = Address(i6.GetAddress
(1,1));
Since this is an example, and ppl is supposed to crawl the code, point out why
we need to search GetAddress(1,1) in IPv6 and GetAddress(1) is enough in IPv4
(it's equivalent to GetAddress(1,0) for IPv4).

Also, maybe it would be "good for teaching" to print all the IP numbers for all
the interfaces assigned to the node, just to show the dumb user the differences.

http://codereview.appspot.com/5654053/diff/1/examples/tcp/tcp-echo-example.cc...
examples/tcp/tcp-echo-example.cc:125: serverApps.Stop (Seconds (10.0));
The server should stop after the client. Use Seconds(11)

http://codereview.appspot.com/5654053/diff/1/examples/tcp/tcp-echo-example.cc...
examples/tcp/tcp-echo-example.cc:130: echoClient.SetAttribute ("MaxPackets",
UintegerValue (1));
Send a couple of packets instead of just one ?

http://codereview.appspot.com/5654053/diff/1/examples/tcp/tcp-echo-example.cc...
examples/tcp/tcp-echo-example.cc:133: ApplicationContainer clientApps =
echoClient.Install (nodes.Get (0));
Fill the packet data with something like "Hello Word" maybe.

http://codereview.appspot.com/5654053/diff/1/src/applications/helper/tcp-echo...
File src/applications/helper/tcp-echo-helper.h (right):

http://codereview.appspot.com/5654053/diff/1/src/applications/helper/tcp-echo...
src/applications/helper/tcp-echo-helper.h:3: * Copyright (c) 2008 INRIA
copyright to be fixed

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
File src/applications/model/tcp-echo-client.cc (right):

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
src/applications/model/tcp-echo-client.cc:3: * Copyright 2007 University of
Washington
copyright to be fixed

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
src/applications/model/tcp-echo-client.cc:17: */
missing authors

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
File src/applications/model/tcp-echo-client.h (right):

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
src/applications/model/tcp-echo-client.h:17: */
missing authors

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
File src/applications/model/tcp-echo-server.cc (right):

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
src/applications/model/tcp-echo-server.cc:17: */
missing authors

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
File src/applications/model/tcp-echo-server.h (right):

http://codereview.appspot.com/5654053/diff/1/src/applications/model/tcp-echo-...
src/applications/model/tcp-echo-server.h:18: 
missing authors

http://codereview.appspot.com/5654053/diff/1/src/applications/test/tcp-echo-t...
File src/applications/test/tcp-echo-test-suite.cc (right):

http://codereview.appspot.com/5654053/diff/1/src/applications/test/tcp-echo-t...
src/applications/test/tcp-echo-test-suite.cc:2: 
missing a lot of stuff

http://codereview.appspot.com/5654053/diff/1/src/network/utils/address-utils.cc
File src/network/utils/address-utils.cc (right):

http://codereview.appspot.com/5654053/diff/1/src/network/utils/address-utils....
src/network/utils/address-utils.cc:131: 
Those should maybe go in the Address base class ? We should think about it.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b