opensource.google.com

Menu

ns-3 networks with students over the summer

Wednesday, October 31, 2012


ns-3 is a discrete-event network simulator, with a particular emphasis on network research and education. ns-3 aims to allow researchers to move effortlessly between simulations, testbeds, and live experiments. It is designed to offer a high degree of realism in its models, through frameworks for running real application and kernel code, and also for integrating with virtual machine environments and testbeds.

At the end of the summer, we asked mentors of each of our Google Summer of Code projects to provide summaries of their respective students’ contributions over the summer, each of which is listed below.
Dizhi Zhou developed a set of MAC schedulers to be used with the ns-3 LTE module. The ns-3 LTE module already supported a real-world API (the FemtoForum LTE MAC Scheduler Interface Specification) for the implementation of LTE MAC schedulers. When the summer started only a couple of simple scheduler implementations were available (Round Robin and Proportional Fair). To address this problem, Dizhi implemented eight schedulers (FDMT, TDMT, TTA, FDBET, TDBET, FDTBFQ, TDTBFQ, PSS). In addition to the implementations, Dizhi put a significant effort into writing documentation and validating the performance of the new schedulers using some known reference scenarios. The result is a set of well-documented and well-tested scheduler models that are expected to be merged with the main ns-3 code soon, and will be very useful for many ns-3 users.
By Nicola Baldo, Mentor
Sindhuja Venkatesh developed IPv4 Netfilter and NAT code for ns-3 during her 2012 Google Summer of Code project. This project started by picking up netfilter and connection tracking code that had been partially completed during a previous Google Summer of Code project by Qasim Javed. The first portion of the program worked on updating and refining the Netfilter portion of the code, which provides an extensible mechanism for inserting packet filtering and mangling operations into well-defined locations in the IPv4 stack.  As proof-of-concept, a basic NAT was written on top of this framework.  After the midterm exam, Sindhu continued to work on more complete NAT models by writing dedicated IPv4 NAT code hooked into the netfilter framework.  Two primary modes of NAT were implemented, a static one-to-one NAT and a dynamic NAT with port translation.  A NAT helper object was also written, along with a few examples and documentation for the models.  While there remain a few loose ends to complete before merging to ns-3-dev, we are hopeful to be able to complete and merge these models in the next ns-3 release cycle.
By Tom Henderson, Mentor
Mudit Gupta spent his summer designing and developing interfaces aimed at integrating ns-3 with an HLA (High Level Architecture) Federation. The first issue Mudit was faced with was how to communicate between the various federates. Although ns-3 is compliant with the latest LLVM compilers, the HLA components are not. Hence it was impossible to simply integrate the C++ HLA interfaces into ns-3. The chosen workaround was to build a Java ns-3 Federate object acting as a stub and communicating with the main ns-3 code through “normal” sockets. This solution is sub-optimal and the plan is to move to proper C++ interfeces as soon as the HLA implementations (i.e., Portico or CERTI) will be updated to support LLVM. The second problem was to synchronize the ns-3 time reference with the Federation one. The solution relies on a modification of the real-time ns-3 scheduler, with a virtual clock advanced by the RTI Federation messages rather than the hardware PC clock. The last issue Mudit worked on was the interaction between the Federates. The ns-3 module is able to receive Objects from the Federates along with their Attributes but such Objects and Attributes are currently unspecified, as there is no actual ns-3 module using them. A proof-of-concept module has been developed, showing how to receive the Object and its Attributes.
By Tommaso Pecorella, Mentor

We hope Dizhi, Sindhujha, and Mudit will continue their involvement with the ns-3 project, and community outside of Google Summer of Code as well. On a concluding note, we’d like to thank Google once again for accepting us into the program this year. We look forward to applying for Google Summer of Code 2013!

By Lalith Suresh, ns-3 Organization Administrator

Get Ready to Vote with Google

Monday, October 29, 2012


(Cross-posted from the Official Google Blog and the Politics and Elections blog)
Every four years in the United States, people prepare to head to the polls and increasingly search for information about how to register to vote, where to vote and who is on their ballot. Even though it is 2012, important voting information is disorganized and hard to find on the Internet. To help voters research candidates and successfully cast their ballot on Election Day, we’ve launched our new Voter Information Tool. 


You can enter your address to find information on your polling place, early vote locations, ballot information with links to candidates’ social media sites and voting rules and requirements. The tool is easy to embed on any website and is open source so developers can modify it to create custom versions. We're working with a number of media partners to ensure the tool is accessible across the web, and partners like Foursquare and AT&T are doing great work building apps on our Civic Information API. 

We hope this tool will help make getting to the polls and casting your ballot as simple as possible.


Lenses, Folds, and Traversals: Haskell Meet-up

Wednesday, October 24, 2012

The Google San Francisco office hosted a talk by Edward Kmett called "Lenses, Folds, and Traversals" which was well attended by the local Bay Area Haskell Users group as well as Google employees on Thursday, October 18,  2012. Almost 100 people turned up to hear why the power is in the dot (as explained by Gavin Bierman, Erik Meijer and Wolfram Schulte in their 2002 paper "The essence of data access in Cω: The power is in the dot"). This paper pushed the boundaries of our understanding of how to build data-access features for programming languages that go beyond naıve access via simple APIs) by greatly generalizing member access (e.g. over choice types). Although this paper resorted to the creation of a new language to support innovations in data-access (and concurrency) this talk by Edward showed how generalized member-access could be achieved using just a regular library in Haskell as exemplified by his lens library.

Edward presented a beautifully crafted set of APL-like combinators that allow programmers to navigate through structured data and perform generalized operations for access and modification. The core concept in the library is of a lens which groups together a 'setter' and a 'getter':

data Lens a b = Lens { set :: a -> b -> a
                    , view :: a -> b
                    }

where informally the idea is that a lens give you a way to extract from an object (of type a) some information (of type b) by using the view function and also to let you perform the reverse i.e. using the set function, take an object of type a and a value of type b and return a new object of type a with the sub-information about type b suitably incorporated. The actual definition of lens in Edward's library is different (it is cast in terms of a functor). Lenses are essentially composable functional references. The talk showed how lenses can be composed using the ordinary function composition operator (.) in Haskell. The talk then illustrated a scheme for performing lens-based folds and traversals in a highly composable manner and climaxed with the impossible: the overloading of function application. For the grand finale, Edward explained how lenses are just the functors, foldables, traversals and functions that (hard-core Haskell) people already know how to use.

Here is a specific example which shows the result of computing an expression using Haskell's command-line interpreter:

ghci> over (mapped._2) succ [(1,2),(3,4)]
[(1,3),(3,5)]

Informally, here we see the successor function succ applied to the second element of every structure contained by the top-level structure i.e. 2 is mapped to 3 and 4 is mapped to 5. The over function is used to modify the target of a lens (or all the targets of setters or traversals) with a function. The mapped function is a setter that can be used to map over all the values in a functor. The _2 operation accesses the second field of a tuple.

You can view Edward's slides and an earlier talk on the subject. Alternatively, @PLT_Borat could have just told you that "Costate Comonad Coalgebra is the equivalent of Java's member variable update technology for Haskell".

By Satnam Singh, Google

Ashier: Automating Terminal Interactions with Templates

Sunday, October 21, 2012


We are pleased to announce the open source release of Ashier, a utility that allows users to automate terminal interactions with templates.

Have you ever returned from lunch, only to find that the program you started an hour ago had made no progress because it was waiting for you to answer a trivial question?  Terminal interaction automation is a technique that automatically enters commands and answers program prompts in a terminal even when you are away from the keyboard.

Ashier offers several advantages over traditional tools (such as expect): a template language that replaces regular expressions in many situations, support for nested multiline textual data parsing, and the ability to integrate with response logic implemented in any language.

Ashier aims to make terminal interaction automation simpler and more accessible to users — so you can spend less time at your computer and still get more work done.

By Chuan-kai Lin, Site Reliability Engineering Team

Celebrating Dart’s birthday with the first release of the Dart SDK

Tuesday, October 16, 2012


Working with a combination of small scripts to create large web apps is no easy task.  This is why a year ago we released a technology preview of Dart, a project that includes a modern language, libraries and tools for building complex web applications. Today, after plowing through thousands of bug reports and feature requests from the web community, a new, more stable and comprehensive version of Dart is now available and ready to use.


Dart is carefully designed so that you can build your web apps without having to choose between static and dynamic languages. With Dart, you can start coding simple scripts on your own and scale seamlessly to building large apps with hundreds of thousands of lines of code.  These complex apps can also be supported by a big team with a significantly reduced debugging and maintenance overhead.

With this first developer-oriented version of the Dart SDK, we’ve made several improvements and added many features:

• A faster Dart Virtual Machine that outperforms even V8 on some Octane tests.
• A new Dart to JavaScript translator that generates fast and compact output.
• An HTML library that works transparently on modern browsers.
• A library to interoperate with JavaScript code.
• An easy to use editor.
• Pub, a new package manager
• Dartium, a Chromium build with native Dart support.
• A server-side I/O library.
• A language specification describing the Dart semantics, including new features.

Over the following months, we will continue to work hard to evolve the SDK, improve Dart’s robustness and performance, and fine-tune the language while maintaining backwards compatibility.

You can download the Dart Editor from dartlang.org. It comes with a copy of the open-source SDK and Dartium. Thanks again for all your feedback - keep it coming.

Posted by Lars Bak, Software Engineer

.