2006년 4월 27일 목요일

All about FPGAs

Source: http://www.pldesignline.com/shared/article/showArticle.jhtml?articleId=183701630



March 21, 2006

All about FPGAs

An industry expert examines field-programmable gate arrays (FPGAs), including current and forthcoming architectures, technologies, and software tools.

By Bob Zeidman

This article examines field-programmable gate arrays (FPGAs) and their underlying architectures and technologies. We will also examine current and up-and-coming software tools that are designed to allow you to squeeze more functionality into these chips in less time, running at faster speeds, and using less power.

Introduction
The first section of this article deals with the internal architecture and characteristics of typical FPGA devices, allowing you to decide which particular device is right for your design. The next section examines new FPGA architectures being offered by various vendors. The final section looks at some new software tools to help you with your designs.

The basics of FPGAs
Field-programmable gate arrays (FPGAs) are so-called because they are structured very much like the now-obsolete "gate array" form of application specific integrated circuit (ASIC). In fact, FPGAs essentially killed the gate array ASIC business. In the not-so-distant past, FPGAs were marketed for primarily two uses: (a) for prototyping ASICs and (b) for use in systems to achieve time-to-market knowing that they would be replaced with an ASIC implementation at the earliest opportunity.

With regard to this latter point, FPGAs can be programmed on your desk top in minutes while ASICs require weeks to fabricate a new design. As FPGA speeds increased, power consumption decreased, and prices decreased, FPGAs began shipping in products without any intention of replacing them with equivalent ASICs. Of course FPGAs are still good at prototyping ASICs and they are still used that way.

FPGA architectures
Each FPGA vendor has its own FPGA architecture, but in general terms they are all a variation of that shown in Fig 1. The architecture consists of configurable logic blocks, configurable I/O blocks, and programmable interconnect. Also, there will be clock circuitry for driving the clock signals to each logic block. Additional logic resources such as ALUs, memory, and decoders may also be available. The three basic types of programmable elements for an FPGA are static RAM, anti-fuses, and flash EPROM.


1. Generic FPGA architecture.

Configurable Logic Blocks (CLBs): These blocks contain the logic for the FPGA. In the large-grain architecture used by all FPGA vendors today, these CLBs contain enough logic to create a small state machine as illustrated in Fig 2. The block contains RAM for creating arbitrary combinatorial logic functions, also known as lookup tables (LUTs). It also contains flip-flops for clocked storage elements, along with multiplexers in order to route the logic within the block and to and from external resources. The multiplexers also allow polarity selection and reset and clear input selection.


2. FPGA Configurable logic block (CLB) (courtesy of Xilinx).

Configurable I/O Blocks: A Configurable input/output (I/O) Block, as shown in Fig 3, is used to bring signals onto the chip and send them back off again. It consists of an input buffer and an output buffer with three-state and open collector output controls. Typically there are pull up resistors on the outputs and sometimes pull down resistors that can be used to terminate signals and buses without requiring discrete resistors external to the chip.

The polarity of the output can usually be programmed for active high or active low output, and often the slew rate of the output can be programmed for fast or slow rise and fall times. There are typically flip-flops on outputs so that clocked signals can be output directly to the pins without encountering significant delay, more easily meeting the setup time requirement for external devices. Similarly, flip-flops on the inputs reduce delay on a signal before reaching a flip-flop, thus reducing the hold time requirement of the FPGA.


3. FPGA Configurable I/O block (courtesy of Xilinx).

Programmable Interconnect: In Fig 4, a hierarchy of interconnect resources can be seen. There are long lines that can be used to connect critical CLBs that are physically far from each other on the chip without inducing much delay. Theses long lines can also be used as buses within the chip.

There are also short lines that are used to connect individual CLBs that are located physically close to each other. Transistors are used to turn on or off connections between different lines. There are also several programmable switch matrices in the FPGA to connect these long and short lines together in specific, flexible combinations.

Three-state buffers are used to connect many CLBs to a long line, creating a bus. Special long lines, called global clock lines, are specially designed for low impedance and thus fast propagation times. These are connected to the clock buffers and to each clocked element in each CLB. This is how the clocks are distributed throughout the FPGA, ensuring minimal skew between clock signals arriving at different flip-flops within the chip.

In an ASIC, the majority of the delay comes from the logic in the design, because logic is connected with metal lines that exhibit little delay. In an FGPA, however, most of the delay in the chip comes from the interconnect, because the interconnect - like the logic - is fixed on the chip. In order to connect one CLB to another CLB in a different part of the chip often requires a connection through many transistors and switch matrices, each of which introduces extra delay.


4. FPGA programmable interconnect (courtesy of Xilinx).

Clock Circuitry: Special I/O blocks with special high drive clock buffers, known as clock drivers, are distributed around the chip. These buffers connect to clock input pads and drive the clock signals onto the global clock lines described above. These clock lines are designed for low skew times and fast propagation times. Note that synchronous design is a must with FPGAs, since absolute skew and delay cannot be guaranteed anywhere but on the global clock lines.

SRAM vs. Antifuse vs. Flash
There are three competing technologies for programming FPGAs. SRAM programming involves a small static RAM bit for each programming element. Writing the bit with a zero turns off a switch, while writing with a one turns on a switch. Another method involves an antifuse that consists of a microscopic structure that, unlike a regular fuse, normally makes no connection. A large amount of current during programming of the device causes the two sides of the antifuse to connect. A third and relatively new method uses flash EPROM bits for each programming element.

The advantages of SRAM-based FPGAs - the most common programming technology by far - is that they use a standard fabrication process that chip fabrication plants are always optimizing for better performance. Since the SRAMs are reprogrammable, the FPGAs can be reprogrammed any number of times, even while they are in the system, just like writing to a normal SRAM. SRAM devices can easily use the internal SRAMs as small memories in the design.

The disadvantages of SRAM-based FPGAs are that they are volatile, which means a power glitch could potentially corrupt the contents of the device. SRAM devices have large routing delays and are slower than other technologies, in theory, but continually improving SRAM technology has effectively eliminated this disadvantage. SRAM FPGAs can consume more power and are less secure than other technologies because they must be reprogrammed upon power-up and the programming bitstream can be observed going into the device. Custom SRAM FPGAs with built-in keys that unencrypt incoming program bit streams can be purchased from vendors, but this reduces the low cost and fast lead time advantage of the FPGA. Bit errors are also more likely with SRAM FPGAs than with the other devices. The market has decided that the advantages of SRAM FPGAs outweigh the disadvantages as they are by far the dominant FPGA technology.

The advantages of antifuse FPGAs are that they are non-volatile and the delays due to routing are very small, so they tend to be faster. Antifuse FPGAs tend to require lower power and they are better for keeping your design information out of the hands of competitors because they do not require an external device to program them upon power-up as SRAM devices do. The disadvantages are that they require a complex fabrication process, they require an external programmer to program them, and once they are programmed, they cannot be changed. The complex, nonstandard fabrication process has turned out to be a key disadvantage as antifuse FPGAs have lower yields and the technology has improved more slowly than SRAM FPGAs.

Flash FPGAs seem to combine the best of both of the other methods. They are nonvolatile like antifuse FPGAs, yet reprogrammable like SRAM FPGAs. They use a standard fabrication process like SRAM FPGAs and they are lower power and secure like antifuse FPGAs. They are also relatively fast. Currently, one vendor supports flash FPGAs and another vendor has a hybrid flash/SRAM FPGA. They are not catching on as fast as I expected, though that could change in the future.

Example FPGA families
Examples of SRAM FPGA families include the following:
  • Altera Stratix II and Cyclone II families
  • Atmel AT6000 and AT40K families
  • Lattice LatticeEC and LatticeECP families
  • Xilinx Spartan-3 and Virtex-4 families
Examples of antifuse FPGA families include the following:
  • Actel SX and Axcelerator families
  • Quicklogic Eclipse II family
Examples of flash FPGA families include the following:
  • Actel ProASIC family
Examples of hybrid flash/SRAM FPGA families include the following:
  • Lattice LatticeXP family
Emerging technologies
Cores: When I talk about a "core" I am simply referring to a large self-contained function. There are two basic types of cores. The soft core, known as an IP core, is a function that is described by its logic function rather than by any physical implementation. Soft cores usually consist of hardware description language (HDL) code. Hard cores, on the other hand, consist of physical implementations of a function. With respect to FPGAs, these hard cores are known as embedded cores because they are physically embedded onto the chip die and surrounded by programmable logic.

Many FPGA vendors have begun offering cores. The density of programmable devices is increasing, enabling what is called a Programmable System on a Chip (PSOC). Whereas programmable devices were initially developed to replace glue logic, entire systems can now be placed on a single programmable device. SOCs include of all kinds of complicated devices, like processors. In order to place these complex functions within a programmable device, there are three options: the first is to either (a) design the function yourself and place it in the programmable logic, (b) purchase the HDL code for the function and incorporate it into your HDL code, or (c) get the vendor to include the function as a cell embedded in the programmable device. The second option is the IP core or soft core, while the third option is the embedded core or hard core.

IP Cores: IP cores are often sold by third party vendors that specialize in creating these functions. Recently, FPGA vendors have begun offering their own soft cores. IP cores reduce the time and manpower requirements for the FPGA designer. IP cores have already been designed, characterized, and verified. Also, IP cores can often be modifiable, meaning that you can add or subtract functionality to suit your needs. They are also portable from one vendor to another.

But IP cores may also be expensive. Electrical characteristics such as timing or power consumption for IP cores can be optimized to a limited degree, but the actual characteristics depend on its use in a particular device and also depend on the logic to which it is connected. IP cores purchased from a third party may not be optimized for your particular FPGA vendor's technology. You may not be able to meet your speed or power requirements, especially after you have placed and routed it.

Embedded Cores: The embedded core is ideal for many users, which is one reason why programmable device vendors are now offering embedded cores in their devices. The embedded core will be optimized for the vendor's process to give you good timing and power consumption numbers. The function will be placed as a single cell on the silicon die and so the performance of the function will not depend on the rest of your design since it will not need to be placed and routed.

Some embedded cores are analog devices that cannot be designed into an ordinary FPGA. By integrating these functions into the device, you can avoid the difficult process of designing analog devices, and you save the chips and components that would otherwise be required outside the programmable device.

Of course there is a drawback to embedded cores. By using an embedded core in your programmable device, you tie your design into a single vendor. Unless another vendor offers the same embedded core, switching to another vendor will require a large effort and will not be pleasant.

Processor Cores: Processor cores are one of the types of cores commonly available as IP cores or embedded cores. These processors tend to be those that are designed for embedded systems since, almost by definition, programmable devices are embedded systems.

If the processor core is embedded, you will be using a processor that has been optimized and has predictable timing and power consumption. For either type of core, tools will be readily available for software development. Off-the-shelf cross compilers and simulators can be used to debug code before the design has been completed and the programmable device is available.

An example of an FPGA with an embedded processor, along with other embedded cores, is shown in Fig 5.


5. FPGA with embedded processor core (courtesy of Quicklogic).

DSP Cores: Digital Signal Processors (DSPs) are another common type of core that is offered as an IP core or an embedded core. These are essentially specialized processors that are used for manipulating analog signals. They are commonly used for filtering and compression of video or audio signals.

Many engineers have argued that as general processors become faster, DSPs will be less useful because the same functions can be accomplished using the generic processors. However, video and audio digitization, compression, and filtering requirements have increased in recent years as millions of users connect to the Internet and regularly upload and download all kinds of information over relatively limited bandwidth connections. So far, DSP demand for use in networking and graphics devices has been increasing, not decreasing.

Analog Cores: FPGA vendors have begun to include analog cores in their FPGAs. For example, PHY cores are the analog circuitry that drives networks. Many companies are now integrating this functionality onto their devices. Because these devices include specialized analog circuitry, they are available only as embedded cores.


6. FPGA with embedded PHY core (courtesy of Actel).

A functional block diagram of an FPGA that includes an embedded processor core, embedded digital peripheral cores, and embedded analog cores is shown in Fig 6.

Special I/O Drivers: Special I/O drivers are also being embedded into programmable devices. The newer buses inside personal computers need to have very tightly controlled timing and must be driven by special high-drive, impedance-matched circuits. The I/O buffers need to have inputs with very specific voltage threshold values. Many vendors now offer programmable devices with I/O that meet these special requirements. Many times, this is the only way to design a programmable device that can interface with these buses without external chips and components.

New Architectures: New basic architectures are being developed for the logic blocks that comprise FPGAs. One new architecture has a logic block that is based on a DSP, as shown in Fig 7. This type of FPGA will be better for use in chips that need a significant amount of signal processing. I have certain doubts about this future path, though. First, the majority of programmable devices do not perform any DSP, so this architecture targets a relatively small market. Second, special tools will be needed to convert digital signaling algorithms for use in such a specialized FPGA. These tools will need to optimize the algorithm very well so that performance in this specialized FPGA can actually perform better than a standard DSP, or a generic processor, running code that has been optimized using tools and compilers that have been available for years.


7. DSP core cell in an FPGA (courtesy of Altera).

New tools
The most significant area for the future, I believe, lies in the creation of new development tools for FPGAs. As programmable devices become larger, more complex, and include one or more processors, there is a huge need for tools to take advantage of these features and optimize the designs.

As FPGAs come to incorporate processors, development tools are needed for software just as much as for hardware. Hardware synthesis tools allow hardware engineers to work at higher levels of abstraction, without the need to understand the details of the underlying hardware architectures. Similarly software synthesis tools are needed to allow software engineers to work at a higher level of abstraction without the need to understand the details of the underlying software architecture.

Ultimately, there will have to be a melding of hardware and software expertise in an FPGA designer. System level issues must be understood and addressed. Future intelligent tools will work with libraries of pre-tested hardware objects and software functions, leaving "low-level" C and Verilog design necessary only for unique, specialized sections of hardware or software.

Eventually, platform FPGAs with embedded processors will become the dominant platform for embedded system design, and will finally allow the fulfillment of the promise of, and force further development of, hardware/software co-design tools.

Conclusion
This article has presented an overview of current and emerging FPGA technologies, architectures, and tools. You are now prepared to delve into your first or fiftieth FPGA design with the confidence that your knowledge is up to date and that you have the ability to accurately evaluate the various FPGA vendors and their families, and the software tools needed to ensure your design works as required.

Bob Zeidman is the president of Zeidman Technologies (http://www.zeidman.biz/), a company that develops hardware/software co-design tools. He is also president of Zeidman Consulting (http://www.ZeidmanConsulting.com/), a contract research and development firm. Among his publications are technical articles on hardware and software design methods as well as three textbooks: Designing with FPGAs and CPLDs, Verilog Designer's Library, and Introduction to Verilog. Bob holds two patents and earned bachelor's degrees in physics and electrical engineering at Cornell University and a master's degree in electrical engineering at Stanford University. Bob can be contacted at Bob@ZeidmanConsulting.com.

All material on this site Copyright © 2006 CMP Media LLC. All rights reserved

2006년 4월 25일 화요일

VHDL Syntax

VHDL Syntax (IEEE Std 1076-1987)
-
http://mikro.e-technik.uni-ulm.de/vhdl/vhdl87_syntax.html

VHDL Syntax (IEEE Std 1076-1993)
-
http://mikro.e-technik.uni-ulm.de/vhdl/vhdl93_syntax.html

VHDL samples (references included)

Source: http://www.csee.umbc.edu/help/VHDL/samples/samples.html

The sample VHDL code contained below is for tutorial purposes.An expert may be bothered by some of the wording of the examplesbecause this WEB page is intended for people just starting tolearn the VHDL language. There is no intention of teachinglogic design, synthesis or designing integrated circuits.It is hoped that people who become knowledgeable of VHDL willbe able to develop better models and more rapidly meet whatevertheir objectives might be using VHDL simulations.

Verilog Coding Styles for Synthesis

Source: http://ee.ucd.ie/~finbarr/verilog/

Synthesizeable Verilog Code Examples
This page gives FREE synthesizable verilog code examples, block diagrams and timing diagrams of typical digital circuit building blocks.
Last update August 2000

2006년 4월 7일 금요일

uCdot | Getting Started with uClinux

http://www.ucdot.org/article.pl?sid=02/09/03/1357255

This article shows how to get started with uClinux on the Pilot and ARMulator emulators. As no hardware is needed it's a good way to get your feet dirty in uClinux.

커널 2.6 Intro

커널 2.6 Intro  (2006/03/21)

커널 2.6에 대한 간략한 소개와 커널 컴파일에 대해 설명하고 있는 KLDP 위키 문서 입니다

링크만 걸어드릴게요 ^_^

http://wiki.kldp.org/wiki.php/Kernel%202.6%20Intro

2006년 3월 18일 토요일

+ 좋은 아이디어를 내는 필요 충분 조건(펌)

+ Google’s services

출처: http://www.thirdtype.net/tt/index.php?pl=511

Here’s the big list of Google’s services:

  • Add to Google lets publishers create a custom “Add to Google” button for their RSS feeds. When a user clicks the button, they can choose to either add the feed to Google Reader, or the Google Homepage service.
  • Blogger is Google’s blog-hosting and creation service which seems to be very popular on the web because of the price (free) and ease of use.
  • Froogle is Google’s product search engine that you can use to find the cheapest price for a product.
  • GMail (or Google Mail) is Google’s popular email service, that gives you over 2 gigabytes of storage.
  • Google AdSense is Google’s contextual advertising service, popular among many websites. Google also released Onsite Advertiser Sign-Up on November 21, 2005 which lets advertisers buy ads on a site directly from the Google Ads on that page.
  • Google AdWords is the other side of AdSense. While AdSense lets publishers put ads on their site, someone has to pay for those ads, and AdWords connects companies with publishers so you can make a little bit of money.
  • Google Alerts are e-mail updates to particular searches you do on Google. Pretty useful for monitoring websites or news.
  • Google Analytics crawls your website and keeps track of your visitors through a small piece of Javascript. Great tool for webmasters trying to improve their stats and AdSense revenue.
  • Google Answers lets you hire someone to research a topic or answer a question for you.
  • Google Base looks like its going to be Google’s massive content library, with all sorts of content, uploadable by anyone. Oddly enough, it sounds like EPIC and Google Grid mentioned in this video. Many people are comparing this service to Craigslist.
  • Google Blog Search is very much like the web search service but letting search only through various blogs around the web.
  • Google Book Search allows you to search though books that Google has scanned into their database.
  • Google Catalogs is a search engine for mail-order catalogs.
  • Google Click-to-Call lets users call advertisers directly from Google search results, for free, at Google’s expense.
  • Google Code is Google’s effort to promote and contribute to Open Source software.
  • Google Compute exists as a part of the Google Toolbar and uses your computer’s idle time (when you’re not using it) to compute data from distributed computing projects like Folding@Home.
  • Google Deskbar is essentially an embedded IE window in your Window Taskbar that you can search Google from.
  • Google Desktop is similar to apps like Konfabulator or Dashboard but not as attractive. It offers various widgets and a sidebar which let you do things like searches, aggregate feeds, write notes, check weather, and more.
  • Google Directory which is similiar to Yahoo’s and dmoz’s services, letting you search by category.
  • Google Earth is a desktop application which is basically Google Local on steroids.
  • Google Groups allows you to create a mailing list, read Usenet posts, and generally collaborate with others who share a similar interest.
  • Google Homepage is a webpage which lets you add various widgets like weather, news, horoscopes and more, much like Netvibes.
  • Google Image Search is Google’s slightly-lesser-known service to search for images.
  • Google Labs highlights all the projects Google is working on for future release.
  • Google Local combines data from Google Maps with information on local businesses and venues.
  • Google Maps is a mapping service which also provides driving directions to and from different locations. The service is only available in a few countries (mainly the U.S.) but support for other countries is expected in the future. Google Maps has become quite popular lately thanks to a readily available API which lets people create their own maps.
  • Google Mobile is similiar to Google SMS, but using WAP instead.
  • Google Movie Showtimes lets you type in a zip code or address, and it will find movie theaters and showtimes near that area.
  • Google News is a news portal, aggregated by Google’s computers. Everything is done by machines, so no human interaction.
  • Google Reader is a new product which acts as a web-based RSS reader.
  • Google Ridefinder lets you easily find taxis in some of the major cities around the United States.
  • Google Scholar searches things such as theses, papers, and other research and technical information.
  • Google Search History is technically part of the Google Homepage service, but does have its own page so it warrants a mention. Basically, if you sign in with a Google account, Google will keep track of all your searches done via its web search engine.
  • Google Send to Phone is a little Firefox extension which lets you send text messages to mobile phones via SMS.
  • Google Sitemap helps create particular searches for a web address which can be very useful for webmasters looking to index their own site, or see who is linking to it.
  • Google SMS allows you to access many Google services through your mobile phone through text messaging (message GOOGL to learn more).
  • Google Store isn’t really a service, but rather a place to buy some cool Google merchandise.
  • Google Suggest is just an extension to the normal Google web search engine, but with autocomplete functionality to your searches making it a little easier to find what you need. There is also a Firefox extension available.
  • Google Talk is Google’s IM and VoIP program running on the Jabber network. You need a Gmail account to use this.
  • Google Toolbar is the swiss army knife of toolbars, if ever there was one letting your use the various Google web services from your toolbar, as well as offering other interesting information like a site’s PageRank and more.
  • Google Language Tools lets you translate a phrase or entire website, as well as giving you access to web search in different languages, or the ability to search for a particular something in just one language.
  • Google Video and Google Video Upload offer an archive of freely available video clips.
  • Google Web Accelerator supposedly helps load web pages faster, but there have been security and privacy issues raised about this application.
  • Google Web Search is the familiar web search. It also allows you to access certain functions like a calculator, a stock tracker, word definitions, travel information, weather, and more by simply searching for that information (for example, define onomatopoeia or weather 90210). These are not standalone services but a part of web search, which is why I’ve added them here and not into their own section. Additionally, there is the Advanced Search feature for…well…advanced searches which could be more precise than normal searches.
  • Hello is a small IM client which is used in conjunction with Picasa to share pictures with family and friends.
  • Orkut is a networking site similar to Frienster or MySpace, except it is invite only, so if you want to join it, you’ll have to know a guy, who knows a guy.
  • Picasa is a fantastic digital photo organizer application for your desktop.

Now that you know about many of Google’s services, get out there and start Googling!

2006년 3월 13일 월요일

로드밸런싱과 NFS를 이용한 여러대의 서버를 사용하는 방법


제목: 로드밸런싱과 NFS를 이용한 여러대의 서버를 사용하는 방법

글쓴이: SyNoVa (2005년 09월 22일 00시 31분)

이 글은 phpschool의 한사랑님이 쓰신글을 스크랩 해온 것입니다.
===========================================================
+++++++++++++++++++++++++++++++
* 서버 동기화(로드밸런싱관련)
+++++++++++++++++++++++++++++++

들어가는 말
서버 동기화는 일반적으로 로드밸런싱이라고 하기도 한다. 또한 서버 동기화의 경우는 여러가지 형태가 있지만...
여기서는 어떤분의 소개로 되어 있는 rsync를 이용해서 동기화 시키도록 한다. 일반적으로 서버를 동기화 하기 위해 미러링서비스를 하기도 한다.
접속자가 상당히 많은 서버에서 주로 사용하는 방법이다. 웹서버가 10대, 20대 이상되었을때.. 동일한 소스로 동일한 도메인으로 제공하길 원할때 사용하는 방법이다.

여기서 서버는 총 3대로 설명한다.
A서버 : 웹서버1 192.168.0.1
B서버 : 웹서버2 192.168.0.2
C서버 : 웹서버3 192.168.0.3

========== 네임서버 세팅 ======================================
네임서버가 세팅되어 있는 서버에서 네임서버에서 다음과 같이 설정한다.
vi /var/named/domain.com.zone

test1 IN A 192.168.0.1 << - A서버에서 운영된다.
test2 IN A 192.168.0.1 << - A서버에서 운영된다.
test1 IN A 192.168.0.2 << - B서버에서 운영된다.
test2 IN A 192.168.0.3 << - C서버에서 운영된다.

즉, test1.domain.com 의 경우는 A, B서버에서 동일하게 가동이된다. 즉, 어떨때는 A서버에서 또 어떨때는 B서버에서 운영이 된다는 말이다.
test2.domain.com 의 경우는 A, C서버에서 동일하게 가동이된다. 즉, 어떨때는 A서버에서 또 어떨때는 C서버에서 운영이 된다는 말이다.

================================================================

적용방법은
A서버에는 두개의 사이트가 돌어간다고 가정하자.
test1.domain.com (경로 /home/test1)
test2.domain.com (경로 /home/test2)

test1.domain.com 은 B서버와 동기화를 한다.
test2.domain.com 은 C서버와 동기화한다.

한서버에서 여러개의 도메인으로 동기화를 시킬수 있지만. 여기서는 학습상의 목적으로 위와 같이 한다.
환경설정은 A서버에서 B서버와 C서버가 접속할 수 있도록 설정해준다.


========= A서버에서 환경설정 ===============================

#vi /etc/xinetd.d/rsync

# default: off
# description: The rsync server is a good addition to an ftp server, as it # allows crc checksumming etc.
service rsync
{
disable = no <<===== 이부분만 수정하면 된다.
socket_type = stream
wait = no
user = root
server = /usr/bin/rsync
server_args = --daemon
log_on_failure += USERID
}


그 다음 rsync의 설정파일을 수정해 줘야 한다.

rsync의 설정 파일은 rsyncd.conf 파일이다. 물론 이 파일은 원래 존재하지 않는다. 새로 만들어 줘야한다.
#vi /etc/rsyncd.conf

[test1]
path = /home/test1
comment = webservice-dir
uid = root
gid = root
use chroot = yes
read only = yes
hosts allow = 192.168.0.2 <<======= 192.168.0.2서버에서 /home/test1 의 소스를 가져가는것을 허용한다.
max connections = 1
timeout = 300

[test2]
path = /home/test2
comment = webservice-dir
uid = root
gid = root
use chroot = yes
read only = yes
hosts allow = 192.168.0.3 <<======= 192.168.0.3서버에서 /home/test2 의 소스를 가져가는것을 허용한다.
max connections = 1
timeout = 300

추가하길 원한다면.. 위의 항목을 몇몇 더 추가하면 된다.


이렇게 하고,
#/etc/rc.d/init.d/xinetd restart
를 실행하여 적용시킨다.


========== B서버에서 A서버의 자료를 가져가기
rsync -avzrt --delete 192.168.0.1::test1 /home/test1


========== C서버에서 A서버의 자료를 가져가기
rsync -avzrt --delete 192.168.0.1::test2 /home/test2

이렇게만 실행하면 A 서버에 있는 자료를 각각 B서버와 C서버에서 가져가게 된다.
위의 명령어를 매번 실행할 수는 없기에 crontab에 걸어서 매 1분단위로 실행하게 하도록 한다.
처음 개발시에만 그렇게 하고, 나중에 안정화되면 없애는것도 괜찮을듯..

*/1 * * * * root /home/server/cron_shell/rsync.sh << - shell 스크립트를 만들어서 /home/server/cron_shell/rsync.sh에 저장해 두었다.


이작업이 완료되고 나면 A서버와 B,C서버에서 httpd.conf 화일을 수정하여 /home/test1, /home/test2 를 각각 Virtual host 세팅을 하자. 이부분은 생략한다.

이것으로 로드밸런싱 작업은 완료되었다.



-a는 아카이브 모드. 심볼릭 링크, 속성, 퍼미션, 소유권 등 보존
-v 전송 상태를 보여줌
-z 전송시 압축을 함.
-r recursive (하위 디렉토리까지 포함)
-t 변경시간 전송 (이것이 없으면 전송한 시간으로 바뀜)

--delete A서버에는 없는데 B서버에 있다면 지우라는 명령



+++++++++++++++++++++++++++
* NFS로 각 서버 링크
+++++++++++++++++++++++++++
들어가는 말..
webserver에 상당히 많은 파일이 존재하고, 파일에 잦은 접속을 해야하는 경우.. 또는 동영상서비스를 재공해야하는 경우.. 또이미지로 인해 웹서버의 부하 등을 고려해서 여러대의 서버를 운영하는 경우가 있다.. 하지만, 여러대의 서버를 운영하다보면, 도대체가 어디에 무엇이 있는지 또 그 화일을 수정하기 위해서는 어떤서버에 접속해야하는지 난감한 경우가 많다. 그래서 한서버에서 여러대의 서버의 자료들을 컨트롤하기 위해서 사용한다.

즉, D라는 파일서버가 존재하고 이 파일서버는 이미지/동영상/자료실 등을 운영하는 서버이다. url은 http://files.domain.com 이라고 하자.

A웹서버 또는 B웹서버에서 게시판의 파일 업로드를 D서버로 해야하는 경우에..A서버의 폼에서 D서버로 submit을 시켜야하는데.. 이렇게 하면 프로그램을 짜는 사람도.. 상당히 개발이 힘들어지게 된다.
그렇다고 A서버, B서버에서 그 첨부화일을 가지고 있을 수도 없는 노릇이다. 그렇다면 위의 로드밸런싱을 한 서버라면 엄청나게 꼬여버리게 된다.

다시한번 정리를 해 보자.. 위에서 로드밸런싱으로 A서버의 자료를 B서버(또는 C서버)로 복사를 하게 된다. 하지만 이 부분은 어디까지나 개발자가 수정/편집한 화일들을 복사해가는 경우에 지나지 않는다. 사용자들이 첨부화일을 올린것을 A,B서버에 공통으로 가지고 있을 수는 없는 노릇이다. 그럼 이 사용자들의 첨부화일을 D서버에 공통으로 올라가게 하는 방법은 없을까??

NFS를 이용해서 다른서버에 있는 화일을 이서버에 존재하는것처럼 하는 것이다. 즉, 업로드시에는 A서버나 B서버에서 하고, 실제로 다운로드를 하거나 사용자들이 접속하게 되는 경우에는 D서버로 접속해서 받아가는 형태...
이런 자료들을 D서버에 저장하고 다운로드 받기위해 http://files.domain.com/filename.zip 을하게 되면 다운로드가 된다.

A서버와 B서버에서 D서버의 특정폴더를 자신의 것인양 보여지게 하는 방법은 다음과 같다.


1. D서버에서 다음과 같이 설정하자.
#vi /etc/exports
/home/files 192.168.0.1(rw,no_root_squash)
/home/files 192.168.0.2(rw,no_root_squash)

#/etc/rc.d/init.d/nfs restart
#/etc/rc.d/init.d/nfslock stop


2. 이제 D서버의 /home/files폴더를 A, B서버에서 자신의 것인양 사용하려면 마운트를 해야한다.
빠른 mount를 위해서 다음과 같이 설정하자. (A, B서버에서.. 각각)
#vi /etc/hosts
192.168.0.4 files.domain.com files

이제 마운트를 한다.
#mkdir /home/files(A,B서버에서 각각 - 마운트는 미리 폴더를 생성해 두고 한다.)
#mount -t nfs files.domain.com:/home/files /home/files (A, B서버에서 각각)

그리고 /home/files 에가서 확인해 봐라. D서버, A서버, B서버에서 각각 화일을 하나씩 생성해보고 동일한 화일이 존재하는지..
존재할 것이다.

그럼.. 이제 A,B서버에서 게시판이나 기타 다른 프로그램으로 첨부화일을 D서버로 올리는 경우에 저장되는 경로를 /home/files로 저장한다면 될것이다. 물론 chmod를 777 로 해 줘야 할 것이다.

만약 A, B서버에서 위의 mount 명령어를 실행했을때 접속이 안된다는 메시지가 뜨면..
D서버에서 ntsysv 를 실행해서 nfs에 체크하고 nfslock에 체크를 해제한후에 /etc/rc.d/init.d/xinetd restart 를 한후 다시한번 시도 해보아라.


위와 같이 하면, 여러대의 웹서버와 별도의 대용량 파일서버/이미지서버 등의 작업은 한 서버에서 관리하는것이 가능하다.

에궁.. 머리야.. 위의 테스튼 Linux Fedora 3에서 테스트 하고 다른 어떤분의 자료를 바탕으로 작업후 테스트후 내용을 정리한 것입니다.

고유주소: http://www.codedream.net/blog/?no=139

블로그: SyNoVa의 CodeDream.NET (http://www.codedream.net/blog/)

2006년 2월 23일 목요일

SKTelecom - Telecommucations Review

URL: http://tr.sktelecom.com/











  • 매 짝수 달 25일에 발간하여 연간 총 6회 발행하며 특별부록을 1회 이상 발행할 수 있습니다.
  • 호당 게재 논문 수는 15편 이하로 하며, 매 호당 약 5,000부를 발행하여 배포합니다.
  • '논문집' 코너에서 PDF본을 제공하는 방식으로 Cyber출판도 병행합니다.
  • 게재된 논문의 경우 편당 120만원의 연구지원비를 지급합니다.

HTMLArea, the Web-based editor [dynarch.com]

http://www.dynarch.com/projects/htmlarea/

Java mail

http://jwma.sourceforge.net/
http://jmailsrv.sourceforge.net/
http://sourceforge.net/projects/javaemailserver/
http://jwebmail.sourceforge.net/

Open Source Software in Java(tm)


URL: http://java-source.net/

Steve Friedl's Home Page

URL: http://www.unixwiz.net/

Unixwiz.net - Software Consulting Central
Steve Friedl's Home Page

This is the website of Steve Friedl, a software and network security consultant in Southern California. You'll find a collection of tools, tech tips, and other information in the scope of my consulting practice. I've been a C and UNIX developer since 1981 and have an exceptionally broad background in this area. Some areas of expertise include:

  • C and C++ systems software development on the UNIX and Win32 platforms
  • Communications, including serial and TCP/IP based controllers
  • Enterprise internet security administration and configuration
  • Penetration tests, audits, and network reviews
  • Security forensics, reverse engineering, and tools development
  • General UNIX and Windows system/network administration
  • The Windows Printing System
  • Database software development
  • Technology problem solving and research
  • Technical writing and standup training

Pluralsight - Premier Microsoft .NET Training: Tools


http://www.pluralsight.com/tools.aspx

RAID

아래 그림을 보면 RAID의 구성방법이 한방에 이해가 된다...^^;

2006년 2월 22일 수요일

[아이뉴스24] 한국MS, 개인정보 보안강화용 윈도XP 공유컴퓨터 툴킷 발표

한국MS, 개인정보 보안강화용 윈도XP 공유컴퓨터 툴킷 발표

한국마이크로소프트(사장 유재성)가 공용 컴퓨터를 효과적으로 관리하고 개인정보 유출을 방지할 수 있는 윈도XP 공유 컴퓨터 툴킷 을 20일 발표했다.

웹사이트를 통해 무료로 내려받을 수 있는 윈도XP 공유 컴퓨터 툴킷 은 학교, PC방 등에 설치돼 있는 공용 컴퓨터에서 불특정 사용자가 변경해 놓은 제어판 설정, 원하지 않는 응용프로그램의 임의 설치, 사용자가 인지하지 못한 개인정보 유출 등을 방지할 수 있는 프로그램이라고 한국MS는 설명했다.

한국MS는 "이번 프로그램은 공용 컴퓨터의 하드 디스크를 무단 변경하지 못하게 하는 방어 기능과 허가되지 않은 사용자가 시스템 설정과 데이터에 접근하지 못하도록 하는 제한 기능을 지니고 있다"며 "사용자에게 보다 친근한 인터페이스를 구성할 수 있는 향상 기능을 통해서는 접속 때마다 사용자 설정과 데이터를 새로 고쳐 개인정보를 보호할 수 있다"고 지적했다.

박준석 한국MS 윈도 클라이언트운영체제 마케팅 담당 부장은 "이번 프로그램은 누구나 쉽게 무료로 내려받을 수 있어 별도 PC 관리자가 없는 학교, 도서관, PC방 등에서 효과적으로 사용할 수 있을 것으로 보인다"며 "최근 공용 컴퓨터를 통한 개인정보 유출 문제가 심각해지고 있어 이러한 문제를 방지하는 데 큰 기여를 할 것"이라고 강조했다.

윈도우XP 공유 컴퓨터 툴킷 에 대한 자세한 내용은 전용 웹 사이트(http://www.microsoft.com/korea/windowsxp/sharedaccess/default.mspx)에서 확인할 수 있다.

/이정호기자 sunrise@inews24.com

출처: 아이뉴스24, 2/20/2006, 2:12:29pm, http://news.inews24.com/php/news_view.php?g_serial=192376&g_menu=020200

2006년 2월 20일 월요일

PCBstandards.com

http://www.pcbstandards.com/

Excellent site for SMT, PCB, electronic design information, and useful Excel spreadsheets for EE related formulas. Hit the "SITE MAP" button for a list of all the documents.